CVE-2026-46634
HIGH 7.7CVSS 4.0Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name
Twig is a template language for PHP. From 3.9.0 until 3.26.0, template_from_string() compiles an inner template under a synthesized string_template<hash> name that can fall outside a SourcePolicyInterface sandbox decision, allowing a sandboxed template that can call template_from_string and include to render an inner template without security policy enforcement. This issue is fixed in version 3.26.0.
- Published
- 14 Jul 2026
- Last modified
- 24 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-693
- Also known as
- GHSA-24x9-r6q4-q93w
- Sources
- NVDJSONOSV GHSA-24x9-r6q4-q93wJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 7.7 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | symfony | twigcpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:* |
>= 3.9.0, < 3.26.0 | 3.26.0 |
| OSV | Packagist | twig/twig | >= 3.9.0, < 3.26.0 | 3.26.0 |
References
- https://github.com/twigphp/Twig/commit/1cde8f2b62463f85d47995fc25f8241cb409d915 · Patch
- https://github.com/twigphp/Twig/releases/tag/v3.26.0 · Release Notes
- https://github.com/twigphp/Twig/security/advisories/GHSA-24x9-r6q4-q93w · Vendor Advisory, WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46634.yaml · WEB
- https://github.com/twigphp/Twig · PACKAGE
- https://symfony.com/cve-2026-46634 · WEB
History
- 25 Nov 2026 21:03 UTC · NVD: first stored (published 14 Jul 2026)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 21 May 2026)