Skip to main content
VulnerabilityPublished Updated

CVE-2024-34064: Jinja2 · Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

Affects Jinja2Source GCVE Database

0
Compare

Mentioned vulnerabilities

Authoritative record:CVE-2024-34064· Medium 5.4

Not known to be exploited · CVSS 5.4 Medium : upgrade to 3.1.4 when convenient.

Data as of 31 Oct 2026, 01:25 UTC

CVSS 3.1 base score
5.4Medium
How severe the flaw is on the 0–10 CVSS scale.

Sources agree

CVSS scores by source
CNA (GitHub_M)CVSS 3.15.4
CISA-ADPCVSS 3.15.4
Patch
Available – fixed in 3.1.4
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 6 May 2024

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponized: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 30 Oct 2026.

What to do

Upgrade Jinja2 to 3.1.4.

Affected software

ProductAffectedFixed in
PyPIJinja2Affected
  • <3.1.4
Fixed in
  • 3.1.4

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade Jinja2 to version 3.1.4 or later where this vulnerability is fixed. Avoid accepting user input as keys to the xmlattr filter without strict validation. Accepting user input as values remains safe. Code that accepts keys as user input should be considered insecure regardless of Jinja2 version.

Description

Jinja2 versions prior to 3.1.4 have a vulnerability in the xmlattr filter where user input passed as keys can include characters that lead to HTML attribute injection. This can allow an attacker to inject additional attributes and potentially perform cross-site scripting (XSS) if the application renders these keys in pages viewed by other users. The issue arises because xmlattr does not restrict keys from containing characters like spaces, '/', '>', or '=', which are invalid in XML/HTML attributes. The vulnerability is fixed in version 3.1.4.

References

Community reviews

Loading reviews…