Cross-site scripting in Twig - CVE-2025-24374

 

Cross-site scripting in Twig - CVE-2025-24374

Published: January 29, 2025 / Updated: May 20, 2026


Vulnerability identifier: #VU131989
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-2025-24374
CWE-ID: CWE-79
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to modify rendered output.

The vulnerability exists due to improper output neutralization in the null coalesce operator handling when rendering templates that use the ?? operator. A remote attacker can supply a crafted left-side expression value to modify rendered output.

User interaction is required to process the crafted content.


Affected software

Twig

How to mitigate CVE-2025-24374

Install security update from vendor's website.

Twig - update to 3.19.0

External References

Related Security Bulletins