{"id":"CVE-2026-46640","published":"2026-07-14T21:22:57Z","modified":"2026-07-16T03:55:34Z","title":"Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation","vendor":"twigphp","product":"Twig","tier":"tail","description":{"text":"Twig is a template language for PHP. From 3.15.0 until 3.26.0, _self.(<string>) and import-alias dynamic attribute syntax can concatenate an attacker-controlled string into a MacroReferenceExpression name without identifier validation, causing raw PHP to be emitted into the generated template source and executed at template-load time. This issue is fixed in version 3.26.0.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.7,"severity":"HIGH","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00642,"percentile":0.51749,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-45vw-wh46-2vx8","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/twigphp/Twig/commit/324fa60545694fa6abe85ded9befcb82e1066bc2","tags":["x_refsource_MISC"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","tags":["x_refsource_MISC"]}],"priority":{"score":16.4,"factors":[{"name":"EPSS percentile","points":10.35},{"name":"CVSS severity","points":6.09}]},"vendorSlug":"twigphp","affectedVersions":[{"vendor":"twigphp","product":"Twig","versions":[">= 3.15.0, < 3.26.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-07-15T00:00:00+00:00","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"twig/twig","vulnerableRanges":[">=3.15.0, <3.26.0"],"patched":["3.26.0"],"from":["GHSA-45vw-wh46-2vx8"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-44569","exploited":false,"provenance":"source"}}