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.
Fix
Patch, vendor advisory and mitigation references on NVD 2
- https://github.com/twigphp/Twig/commit/9ff41014639ef0e8eb50ac7669191c309d863105 Patch
- https://github.com/twigphp/Twig/security/advisories/GHSA-5v5v-ww74-355v Vendor Advisory
Every line above is quoted from NVD, CISA, Microsoft, the vendor's own advisory or DISA; nothing is generated.
Change history 1
- First seenCVSS 7.1 · symfonyNVD modified 2026-10-24 22:10
Affected (CPE criteria) 1
cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*