CVE-2024-51754

lowpriority · track · 0EPSS 0.004 · 38 %ileEUUS
grimoire priorityP3 · Track
Exploitable?
—
no known exploitation
Likely / severe?
0.43% (38th) EPSS
CVSS 2.2 · low
Is it mine?
4 products
Check your exposure
Who says so?
3 sources
cnnvd · enisa_euvd · osv

EPSS · scored 2026-10-28

Twig is a template language for PHP. In a sandbox, an attacker can call `__toString()` on an object even if the `__toString()` method is not allowed by the security policy when the object is part of an array or an argument list (arguments to a function or a filter for instance). This issue has been patched in versions 3.11.2 and 3.14.1. All users are advised to upgrade. There are no known workarounds for this issue.

01

cvss

Technical severity, 0–10. One row per scoring source.

2.2
010

base score 0–10 · higher = more severe · hover a vector to decode

v3.12.2lowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:Nsecondary · ENISA EU
v3.12.2lowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:Nsecondary · security-advisories@github.comexploitability 0.7 · impact 1.4
v3.12.2lowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:Nsecondary · OSV
v3.12.1lowCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N/E:Usecondary · CVSS-BT (t0sche)
02

ssvc

A stakeholder decision — act, attend, or track — from exploitation and impact.

Trackcoordinatorcisa_ssvcUS
03

weaknesses

The CWE weakness classes this flaw belongs to.

04

affected products (4)

Products and version ranges known to be affected.

05

advisories (1)

Vendor and ecosystem advisories describing this.

  • GHSA-6377-hfv9-hqf6Twig has unguarded calls to `__toString()` when nesting an object into an array2024-11-06ghsa · osvUS

    ### Description In a sandbox, an attacker can call `__toString()` on an object even if the `__toString()` method is not allowed by the security policy when the object is part of an array or an argument list (arguments to a function or a filter for instance). ### Resolution The sandbox mode now checks the `__toString()` method call on all objects. The patch for this issue is available [here](https://github.com/twigphp/Twig/commit/cafc608ece310e62a35a76f17e25c04ab9ed05cc) for the 3.11.x branch, and [here](https://github.com/twigphp/Twig/commit/d4a302681bca9f7c6ce2835470d53609cdf3e23e) for the 3.x branch. ### Credits We would like to thank Jamie Schouten for reporting the issue and Fabien Potencier for providing the fix.

06

also known as (3)

Other names and identifiers for this entity.

07

sources

Which sources assert this record, and when.

published 2024-11-06modified 2026-06-17
08

references (8)

External citations — patches, advisories, analysis.

scry

Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.

Free scan