Improper Neutralization Affecting jinja2 package, versions [,3.1.5)


Severity

Recommended
0.0
medium
0
10

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

Threat Intelligence

EPSS
0.05% (18th percentile)

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-PYTHON-JINJA2-8548987
  • published24 Dec 2024
  • disclosed23 Dec 2024
  • creditSimon Leiner

Introduced: 23 Dec 2024

CVE-2024-56201  (opens in a new tab)
CWE-150  (opens in a new tab)

How to fix?

Upgrade jinja2 to version 3.1.5 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization when importing a macro in a template whose filename is also a template. This will result in a SyntaxError: f-string: invalid syntax error message because the filename is not properly escaped, indicating that it is being treated as a format string.

Note: This is only exploitable when the attacker controls both the content and filename of a template and the application executes untrusted templates.

CVSS Scores

version 4.0
version 3.1