CVE-2024-34064

Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

MEDIUM
5.4
CVSS Score
Published: May 6, 2024 at 02:41 PM UTC
Updated: June 17, 2026 at 07:32 AM UTC
3 products affected across 3 vendorsFedoraJinjaJinja

Using jinja by pallets?

Get instant alerts when new vulnerabilities affect jinja - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.4
Exploit prediction
EPSS 1.0%
SSVC
No known exploit

Description

Jinja is an extensible templating engine. The `xmlattr` filter in affected versions of Jinja accepts keys containing non-attribute characters. XML/HTML attributes cannot contain spaces, `/`, `>`, or `=`, as each would then be interpreted as starting a separate attribute. If an application accepts keys (as opposed to only values) as user input, and renders these in pages that other users see as well, an attacker could use this to inject other attributes and perform XSS. The fix for CVE-2024-22195 only addressed spaces but not other characters. Accepting keys as user input is now explicitly considered an unintended use case of the `xmlattr` filter, and code that does so without otherwise validating the input should be flagged as insecure, regardless of Jinja version. Accepting _values_ as user input continues to be safe. This vulnerability is fixed in 3.1.4.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.1.4
Affected range stops below 3.1.4, so it looks safe — our inference, not a vendor statement
v < 3.1.4
Affected range stops below 3.1.4, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

5.4MEDIUMGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-79

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card