{"id":"CVE-2026-46633","title":"Twig: PHP code injection via `{% use %}` template name","summary":"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 craft…","severity":"high","cvss":8.7,"cvssVector":"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","cvssSource":"cna","cwe":["CWE-94"],"vendor":"twigphp","product":"Twig","affected":["Twig >= 1.15.1, < 3.26.0"],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-07-15T00:00:00+00:00"},"published":"2026-07-14","updated":"2026-11-04","sourceUpdated":"2026-11-04T00:01:29.155Z","source":"CVEORG","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-46633","references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp","label":"https://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp"},{"url":"https://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8","label":"https://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8"},{"url":"https://github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30","label":"https://github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30"},{"url":"https://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3","label":"https://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3"},{"url":"https://gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6","label":"https://gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6"},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml","label":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml"},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","label":"https://github.com/twigphp/Twig/releases/tag/v3.26.0"},{"url":"https://symfony.com/cve-2026-46633","label":"https://symfony.com/cve-2026-46633"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46633"},{"url":"https://github.com/advisories/GHSA-7p85-w9px-jpjp"}],"tags":["cve.org","ghsa","composer"],"epss":0.00774,"epssPercentile":0.55909,"aliases":["GHSA-7p85-w9px-jpjp"],"ecosystem":"composer","patched":["twig/twig 3.26.0"],"scores":{"cna":8.7,"ghsa":9.8},"ingestedAt":"2026-11-04T00:59:33.232Z","slug":"CVE-2026-46633","body":"## Overview\n\nTwig 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.\n\n## Affected\n\n- `Twig >= 1.15.1, < 3.26.0`\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.\n\n## Package advisory (CVE-2026-46633)\n\nAffected packages:\n\n- `twig/twig >= 1.15.1, < 3.26.0`\n\nPatched in:\n\n- `twig/twig 3.26.0`\n\nSource: https://github.com/advisories/GHSA-7p85-w9px-jpjp","depth":"twilight","depthScore":48,"depthScoreParts":{"impact":47.8,"likelihood":0.2,"exploitation":0,"ransomware":0},"changes":[{"seq":234002,"id":"CVE-2026-46633","ts":1793910903471,"field":"cvss","old":"9.8","new":"8.7"},{"seq":234001,"id":"CVE-2026-46633","ts":1793910903471,"field":"severity","old":"critical","new":"high"}]}