Improper Encoding or Escaping of Output in Twig - CVE-2026-46628
Published: May 20, 2026
Vulnerability details
The vulnerability allows a remote attacker to execute arbitrary script in the victim's browser.
The vulnerability exists due to improper encoding or escaping of output in the `spaceless` filter when rendering attacker-controlled input in an HTML context. A remote attacker can supply crafted markup that is processed with the filter to execute arbitrary script in the victim's browser.
The issue occurs even when autoescaping is enabled and the developer does not explicitly use the `raw` filter.
Affected software
Debian Linux
php-twig (Debian package)
How to mitigate CVE-2026-46628
php-twig (Debian package) - update to 3.5.1-1+deb12u3