PT-2026-47220 · Twig · Twig
CVE-2026-48807
·
Published
2026-05-27
·
Updated
2026-07-15
CVSS v3.1
9.1
Critical
| Vector | AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
Name of the Vulnerable Software and Affected Versions
Twig (affected versions not specified)
Description
An issue exists where a sandboxed template author can trigger a disallowed
toString() method on objects reachable from the render context, bypassing the security policy. This occurs through two primary mechanisms:-
In
CoreExtension::join()andCoreExtension::replace(),Traversablevalues are not properly policy-checked during recursion. These filters later materialize the inputs, leading to implicit string coercion of containedStringableobjects. -
The
inandnot inoperators, which compile toCoreExtension::inFilter(), use PHP's<=>operator. This causes the object to be coerced to a string viatoString()without consulting the sandbox policy. This can be used as a content-leak oracle to reconstruct strings returned bytoString()through chained probes.
Recommendations
At the moment, there is no information about a newer version that contains a fix for this vulnerability.
Exploit
Protection Mechanism Failure
Incorrect Authorization
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Twig