Intel

AIKIDO-2024-10086

Jinja2 is vulnerable to Cross-site Scripting (XSS)

Cross-site Scripting (XSS)CVE-2024-34064 Published May 6, 2024

50

Medium Risk

This Affects:

pythonJinja2
2.0 - 3.0.2
Fixed in 3.1.4
Are you affected? Scan for Free

TL;DR

The xmlattr filter in affected versions of Jinja accepts keys containing non-attribute characters. XML/HTML attributes cannot contain spaces, /, >, or =, as each would be interpreted as starting a separate attribute. If an application accepts keys (instead of just values) as user input and renders them in pages visible to other users, an attacker could exploit this to inject additional attributes and perform Cross-site Scripting (XSS).

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

Jinja2 is vulnerable to Cross-site Scripting (XSS) in versions 2.0 - 3.0.2.

How to fix this

Upgrade the Jinja2 library to the patch version.

Links

Other