| Name | CVE-2026-46640 |
| Description | 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. |
| Source | CVE (at NVD; CERT, ENISA, LWN, oss-sec, fulldisc, Debian ELTS, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more) |
| References | DSA-6311-1 |
Vulnerable and fixed packages
The table below lists information on source packages.
| Source Package | Release | Version | Status |
|---|
| php-twig (PTS) | bullseye | 2.14.3-1+deb11u2 | fixed |
| bullseye (security) | 2.14.3-1+deb11u4 | fixed |
| bookworm, bookworm (security) | 3.5.1-1+deb12u3 | fixed |
| trixie, trixie (security) | 3.27.0-0+deb13u1 | fixed |
| forky, sid | 3.27.1-1 | fixed |
The information below is based on the following data on fixed versions.
Notes
[bookworm] - php-twig <not-affected> (Vulnerable code not present, introduced in 3.15)
[bullseye] - php-twig <not-affected> (Vulnerable code not present, introduced in 3.15)
https://symfony.com/blog/cve-2026-46640-arbitrary-php-code-execution-via-self-string-macro-reference-compilation