CVE-2026-46633: Twig · PHP code injection via `{% use %}` template name
Affects twig/twigSource GCVE Database
Not known to be exploited · CVSS 8.7 High : upgrade to 3.26.0 soon.
Data as of 4 Nov 2026, 04:46 UTC
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 4.0 | 8.7 |
|---|
- Patch
- Available – fixed in 3.26.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 14 Jul 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 3 Nov 2026.
What to do
Upgrade twig/twig to 3.26.0.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Packagisttwig/twig | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in Twig version 3.26.0 that fixes the vulnerability by properly escaping single quotes in template names. Users should upgrade to version 3.26.0 or later to remediate this issue. No other mitigations are indicated or required.
Description
A critical PHP code injection vulnerability exists in Twig versions >=1.15.1 and <3.26.0 via the `{% use %}` template tag. The issue arises because single quotes in template names are not escaped properly, allowing injection of arbitrary PHP code into compiled cache files. This code executes with the PHP process, bypassing Twig's sandbox and enabling remote code execution. The vulnerability is fixed in version 3.26.0 by escaping single quotes in template names.
References
- github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-46633 (opens in a new tab)
- github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8 (opens in a new tab)
- github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30 (opens in a new tab)
- github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3 (opens in a new tab)
- gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6 (opens in a new tab)
- github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml (opens in a new tab)
- github.com/twigphp/Twig (opens in a new tab)
- github.com/twigphp/Twig/releases/tag/v3.26.0 (opens in a new tab)
- symfony.com/cve-2026-46633 (opens in a new tab)