CVE-2024-22195: Jinja2 · Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
Affects jinja2Source GCVE Database
Not known to be exploited · CVSS 5.4 Medium : upgrade to 3.1.3 when convenient.
Data as of 31 Oct 2026, 01:25 UTC
Thin evidence
One scorer or none| CNA (GitHub_M) | CVSS 3.1 | 5.4 |
|---|
- Patch
- Available – fixed in 3.1.3
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 11 Jan 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.3.
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
A patch is available in Jinja2 version 3.1.3 that fixes this vulnerability. Users should upgrade to version 3.1.3 or later. Additionally, applications should avoid accepting user input as keys to the xmlattr filter or validate keys rigorously to prevent injection of malicious attributes.
Description
Jinja2 versions prior to 3.1.3 have a vulnerability in the xmlattr filter that allows HTML attribute injection when user input is passed as keys. This occurs because keys containing spaces are accepted, which can be interpreted as multiple attributes, enabling potential cross-site scripting (XSS) if untrusted keys are rendered. This issue is mitigated by verifying keys or upgrading to version 3.1.3 or later.
References
- github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95 (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2024-22195 (opens in a new tab)
- github.com/pallets/jinja/commit/716795349a41d4983a9a4771f7d883c96ea17be7 (opens in a new tab)
- github.com/pallets/jinja (opens in a new tab)
- github.com/pallets/jinja/releases/tag/3.1.3 (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/01/msg00010.html (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/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2 (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3 (opens in a new tab)