8.7 HighCWE-94
CVE-2026-46640
Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation
twigphpTwig
Status
- Not in CISA KEV
Exploit probabilityEPSSchecked 25 Oct
0.6%probability of exploitation in the next 30 days
Higher than 50% of scored CVEs
SeverityCVSS
8.7High
Description NVD
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.
Coverage 1 article · 1 outlet
- Critical Twig template flaws let attackers run arbitrary PHP codeSecurityOnline · first in our coverage