PT-2026-45158 · Twig · Twig
CVE-2026-47732
·
Published
2026-05-21
·
Updated
2026-07-14
CVSS v4.0
7.1
High
| Vector | AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N |
Name of the Vulnerable Software and Affected Versions
Twig (affected versions not specified)
Description
SandboxNodeVisitor fails to fully enforce SecurityPolicy::checkMethodAllowed() for implicit toString() calls because the set of wrapped AST nodes in CheckToStringNode is incomplete. This allows a sandboxed template author to invoke toString() on any object reachable in the render context, even if the method is not allowlisted. Bypass vectors include conditional expressions used as input for string-coercing filters or function arguments, the matches operator, loose comparison operators (==, !=, <, >, <=, >=, <=>), and Twig tests such as is empty via CoreExtension::testEmpty(). Additionally, null-coalesce expressions in concatenation, direct output of functions returning Stringable objects, arguments for allowed object methods, template-name expressions in tags like include, extends, and use, dynamic attribute names, spread arguments from Traversable objects, the do tag, and the .. range operator are affected.Recommendations
At the moment, there is no information about a newer version that contains a fix for this vulnerability.
Exploit
RCE
Incorrect Authorization
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Twig