CVE-2026-48806
CRITICALTwig: Sandbox `__toString()` policy bypass via dynamic mapping keys
Title source: cnaDescription
Twig is a template language for PHP. Prior to 3.27.0, ArrayExpression does not guard dynamic mapping keys that are coerced to strings, allowing PHP to invoke __toString() on a Stringable object used as a mapping key without calling SandboxExtension::ensureToStringAllowed(). This issue is fixed in version 3.27.0.
References (3)
Core 3
Core References
X_Refsource_Confirm x_refsource_confirm
https://github.com/twigphp/Twig/security/advisories/GHSA-5v5v-ww74-355v
X_Refsource_Misc x_refsource_misc
https://github.com/twigphp/Twig/commit/9ff41014639ef0e8eb50ac7669191c309d863105
X_Refsource_Misc x_refsource_misc
https://github.com/twigphp/Twig/releases/tag/v3.27.0
Scores
CVSS v3
9.1
EPSS
0.0023
EPSS Percentile
14.4%
Attack Vector
NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CISA SSVC
Vulnrichment
Exploitation
none
Automatable
no
Technical Impact
partial
Details
CWE
CWE-693
CWE-863
Status
published
Products (2)
symfony/twig
< 3.27.0
twigphp/Twig
< 3.27.0
Published
Jul 14, 2026
Tracked Since
Jul 15, 2026