Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. twig/twig
  4. ›
  5. CVE-2025-24374

CVE-2025-24374: Twig security issue where escaping was missing when using null coalesce operator

January 29, 2025 (updated January 30, 2025)

When using the ?? operator, output escaping was missing for the expression on the left side of the operator.

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2025-24374.yaml
  • github.com/advisories/GHSA-3xg3-cgvq-2xwr
  • github.com/twigphp/Twig
  • github.com/twigphp/Twig/commit/38576b12f05df3cc871bf68f39ccb46b418334a3
  • github.com/twigphp/Twig/security/advisories/GHSA-3xg3-cgvq-2xwr
  • nvd.nist.gov/vuln/detail/CVE-2025-24374
  • symfony.com/blog/twig-cve-2025-24374-missing-output-escaping-for-the-null-coalesce-operator

Code Behaviors & Features

Detect and mitigate CVE-2025-24374 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 3.16.0 before 3.19.0

Fixed versions

  • 3.19.0

Solution

Upgrade to version 3.19.0 or above.

Impact 4.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

packagist/twig/twig/CVE-2025-24374.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:42 +0000.