GitHub Advisoryadvisory · Packagist
GHSA-3xg3-cgvq-2xwr Twig security issue where escaping was missing when using null coalesce operator
MEDIUM
Official page ↗
- Aliases
- CVE-2025-24374
- Ecosystem
- Packagist
- Packages
- twig/twig
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
- Weaknesses
- CWE-74
- Reviewed
- 2025-01-29
Affected packages
• Packagist twig/twig: >= 3.16.0, < 3.19.0 → fixed in 3.19.0
Description
When using the `??` operator, output escaping was missing for the expression on the left side of the operator.
Related
Alias · CVE (1)
- CVE-2025-24374 Twig is a template language for PHP. vulnerability
Weakness · CWE (1)
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component weakness
References
- https://github.com/twigphp/Twig/security/advisories/GHSA-3xg3-cgvq-2xwr web
- https://nvd.nist.gov/vuln/detail/CVE-2025-24374 advisory
- https://github.com/twigphp/Twig/commit/38576b12f05df3cc871bf68f39ccb46b418334a3 web
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2025-24374.yaml web
- https://github.com/twigphp/Twig package
- https://symfony.com/blog/twig-cve-2025-24374-missing-output-escaping-for-the-null-coalesce-operator web