CVE-2024-34064: pallets jinja · Cross-site Scripting
Affects pallets jinjaSource CVE Database V5
Mentioned vulnerabilities
Not known to be exploited · CVSS 5.4 Medium : upgrade to 3.1.4 when convenient.
Data as of 25 Oct 2026, 19:02 UTC
- EPSS
- 0.9% chance of exploitation in 30 days – higher than 61% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- 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
Weaponised: 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 2026-10-25.
What to do
Upgrade pallets jinja to 3.1.4.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIjinjapkg:pypi/jinjaOther threats | 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
1. Upgrade all Jinja installations to version 3.1.4 or later to ensure the vulnerability is patched. 2. Audit application code to identify any use of the xmlattr filter where user input is accepted as keys; refactor such code to avoid this practice entirely. 3. Implement strict input validation and sanitization on any user-supplied data that might be used in templating, especially keys for attribute generation. 4. Employ Content Security Policy (CSP) headers to reduce the impact of potential XSS by restricting script execution sources. 5. Conduct security code reviews and penetration testing focusing on template injection and XSS vectors. 6. Educate developers about the risks of accepting user input as keys in templating filters and encourage secure coding practices. 7. Monitor web application logs and user reports for signs of XSS exploitation attempts. 8. If immediate upgrade is not possible, consider temporary mitigations such as disabling features that accept user input as keys or applying custom filters to sanitize keys before rendering.
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.
References
- github.com/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj (opens in a new tab)
- github.com/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb (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/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC/ (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/12/msg00009.html (opens in a new tab)