Skip to main content
← All vulnerabilities
CVE-2026-46633GHSA-7P85-W9PX-JPJP

Twig: PHP code injection via `{% use %}` template name

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. 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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

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

  3. Record last updated

Affected versions

  • twigphp Twig

    fixed in 3.26.0

  • twig/twigPackagist

    fixed in 3.26.0

References 4

GitHub · twigphp/Twig