CVE-2026-46633
HIGH 8.7CVSS 4.0Twig: PHP code injection via `{% use %}` template name
Twig is a template language for PHP. Starting in 1.15.1 and prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.
- Published
- 14 Jul 2026
- Last modified
- 4 Nov 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-94
- Also known as
- GHSA-7p85-w9px-jpjp
- Sources
- NVDJSONOSV GHSA-7p85-w9px-jpjpJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | HIGH 8.7 | CVSS:4.0/AV:N/AC:L/AT:N/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 |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| 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 |
| OSV | GitHub | 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.26.0 | 3.26.0 |
| OSV | Packagist | twig/twig | >= 1.15.1, < 3.26.0 | 3.26.0 |
References
- https://gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6 · WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml · WEB
- https://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8 · Patch, WEB
- https://github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30 · WEB
- https://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3 · Patch, WEB
- https://github.com/twigphp/Twig/releases/tag/v3.26.0 · Release Notes, WEB
- https://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp · Vendor Advisory, WEB
- https://symfony.com/cve-2026-46633 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-46633 · ADVISORY
- https://github.com/twigphp/Twig · PACKAGE
History
- 25 Nov 2026 21:03 UTC · NVD: first stored (published 14 Jul 2026)
- 25 Nov 2026 20:15 UTC · OSV: first stored (published 21 May 2026)