Skip to main content
← All vulnerabilities
CVE-2026-46640GHSA-45VW-WH46-2VX8

Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 3.26.0
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: total

Summary

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • twigphp Twig

    From 3.15.0 · fixed in 3.26.0

  • twig/twigPackagist

    From 3.15.0 · fixed in 3.26.0

References 3

GitHub · twigphp/Twig