CVE-2026-46633: Vulnerability in Symfony Twig
Critical. 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.
Packagist, CWE-94
- Exploitation
- None confirmed
- Severity
- 9.8 of 10
- Attack likelihood
- 0.8 % in 30 days
- Fix
- Fixed version known
- Patch deadline
- No deadline set
Details
- Advisory ID
- GHSA-7p85-w9px-jpjp
- EU ID
- EUVD-2026-44558
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Weakness
- CWE-94
- Published
- 21 May 2026
- Last change
- 4 Nov 2026
- Likelihood rank
- Higher than 52 % of all rated vulnerabilities
- Analysis status
- Modified
- Ecosystem
- Packagist
Affected products
Affected versions and the first fixed release
- Symfony Twig Before 3.26.0. Fixed in 3.26.0
- Twigphp Twig From 1.15.1, before 3.26.0; Version >= 1.15.1, < 3.26.0. Fixed in 3.26.0
Affected packages
Vulnerable version ranges and fixed releases
- twig/twig Packagist, Affected before 3.26.0. Fixed in 3.26.0
Advisories
Vendor and security advisories
- gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6
- github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml
- github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp
- symfony.com/cve-2026-46633
Patches and fixes
Updates, commits and release notes
- github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8
- github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30
- github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3
- github.com/twigphp/Twig/releases/tag/v3.26.0
Related
- Twig vulnerabilities Recent advisories, watch this product
- Twig vulnerabilities Recent advisories, watch this product