Back
CVE-2026-46633
Twig: PHP code injection via `{% use %}` template name
High8.7EPSS 0.77%
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
Description
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.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 4.0 | High8.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 |
| NVDNVD · Modified | 4.0 | High8.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 |
- EPSS (exploitation in 30 days)
- 0.77% · top 44% of all CVEs (6 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
Loading the EPSS history…
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 8.7.
Weakness
Affected products
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Packagisttwig/twigGHSA-7p85-w9px-jpjp (opens in a new tab)
References (8)
- https://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp (opens in a new tab)x_refsource_CONFIRM
- https://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8 (opens in a new tab)x_refsource_MISC
- https://github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30 (opens in a new tab)x_refsource_MISC
- https://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3 (opens in a new tab)x_refsource_MISC
- https://gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6 (opens in a new tab)x_refsource_MISC
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml (opens in a new tab)x_refsource_MISC
- https://github.com/twigphp/Twig/releases/tag/v3.26.0 (opens in a new tab)x_refsource_MISC
- https://symfony.com/cve-2026-46633 (opens in a new tab)x_refsource_MISC
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-7p85-w9px-jpjp (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2026-46633)Record last updated .