CVE-2024-34064: Jinja2 · Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
Affects Jinja2Source GCVE Database
Mentioned vulnerabilities
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
Sources agree
| CNA (GitHub_M) | CVSS 3.1 | 5.4 |
|---|---|---|
| CISA-ADP | CVSS 3.1 | 5.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:NExploitation evidence
Disclosed: evidence found.
CVE published 6 May 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by 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
| Product | Affected | Fixed in |
|---|---|---|
| PyPIJinja2 | Affected
| Fixed in
|
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
- github.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2024-34064 (opens in a new tab)
- github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb (opens in a new tab)
- github.com/pallets/jinja (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/12/msg00009.html (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS (opens in a new tab)