Vulnerability · Published Jul 14, 2026 · Assigned by GitHub_M
CVE-2026-46628Twig: The `spaceless` filter implicitly marks its output as safe
Medium 5.1
In plain English
A medium-severity security flaw in Twig from twigphp. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 22% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 4.0)5.1Medium
Exploit odds (30 days)0.3%top 77.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known
Official description
Twig is a template language for PHP. Prior to 3.26.0, the deprecated spaceless filter is registered as safe for HTML, causing Twig autoescaping to emit attacker-controlled markup unescaped when spaceless is applied to untrusted input. This issue is fixed in version 3.26.0.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | php-twig | 3.5.1-1+deb12u3 | DEBIAN-CVE-2026-46628 |
| Debian:13 | php-twig | 3.27.0-0+deb13u1 | DEBIAN-CVE-2026-46628 |
| Debian:14 | php-twig | 3.26.0-1 | DEBIAN-CVE-2026-46628 |
| Packagist | twig/twig | 3.26.0 | GHSA-4j38-f5cw-54h7 |
| Ubuntu:25.10 | php-twig | no fix listed | UBUNTU-CVE-2026-46628 |
| Ubuntu:26.10 | php-twig | no fix listed | UBUNTU-CVE-2026-46628 |
Affected products (as reported)
Weakness: CWE-116 · Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
References
- https://github.com/twigphp/Twig/security/advisories/GHSA-4j38-f5cw-54h7 x_refsource_CONFIRM
- https://github.com/twigphp/Twig/commit/3190b9ae12614dfd58cc5d8f394bac4708b17913 x_refsource_MISC
- https://github.com/twigphp/Twig/releases/tag/v3.26.0 x_refsource_MISC