{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-46633","id":"CVE-2026-46633","title":"Twig: PHP code injection via `{% use %}` template name","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.","descriptionLong":"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":"2026-07-14T21:14:24.916Z","updated":"2026-11-11T10:47:30.296778169Z","reserved":"2026-05-15T20:11:54.583Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"4.0","score":8.7,"vector":"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","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":8.7,"vector":"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","rating":"high","source":"GitHub_M"},{"version":"4.0","score":8.7,"vector":"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","rating":"high","source":"github.com"},{"version":"4.0","score":null,"vector":"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","rating":"unrated","source":"OSV"},{"version":"4.0","score":null,"vector":"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","rating":"critical","source":"GitHub"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"GitHub"}],"rating":"high","products":["twigphp Twig"],"affectedProducts":[{"vendor":"twigphp","product":"Twig","defaultStatus":null,"versions":[{"version":">= 1.15.1, < 3.26.0","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"Packagist","name":"twig/twig","purl":"pkg:composer/twig/twig","ranges":[">=1.15.1 <3.26.0"],"fixed":["3.26.0"],"advisory":"GHSA-7p85-w9px-jpjp"}],"cwes":["CWE-94"],"aliases":["GHSA-7p85-w9px-jpjp"],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml","tags":["x_refsource_MISC","advisory","web"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","tags":["x_refsource_MISC","Release Notes","web"]},{"url":"https://symfony.com/cve-2026-46633","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46633.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46633","tags":["advisory"]},{"url":"https://github.com/twigphp/Twig","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.00774,"epssPercentile":0.56509,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-46633","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46633","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-46633","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-7p85-w9px-jpjp","ok":true,"note":"GHSA-7p85-w9px-jpjp"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-46633","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}