Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') Affecting twig/twig package, versions >=3.16.0, <3.19.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-TWIGTWIG-8678677
  • published30 Jan 2025
  • disclosed29 Jan 2025
  • creditPhil E. Taylor

Introduced: 29 Jan 2025

NewCVE-2025-24374  (opens in a new tab)
CWE-74  (opens in a new tab)

How to fix?

Upgrade twig/twig to version 3.19.0 or higher.

Overview

twig/twig is a flexible, fast, and secure template language for PHP.

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') due to improper handling of the null coalesce operator ??. This is because of a missing output escaping for the expression on the left side of the operator.

CVSS Scores

version 4.0
version 3.1