Cross-site scripting in Twig - CVE-2026-47730

 

Cross-site scripting in Twig - CVE-2026-47730

Published: May 20, 2026


Vulnerability identifier: #VU131991
CSH Severity: Medium
CVSS v4: 5.1 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N]
CVE-ID: CVE-2026-47730
CWE-ID: CWE-79
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary script in the victim's browser.

The vulnerability exists due to cross-site scripting in Twig\Profiler\Dumper\HtmlDumper when rendering profiler output containing attacker-controlled template or profile names. A remote attacker can supply crafted template or profile names to execute arbitrary script in the victim's browser.

This affects profiler and debug output and is not a sandbox escape.


Affected software

Twig
Debian Linux
php-twig (Debian package)

How to mitigate CVE-2026-47730

Install security update from vendor's website.

Twig - update to 3.26.0
php-twig (Debian package) - update to 3.5.1-1+deb12u3

External References

Related Security Bulletins