CVE-2024-22195: pallets jinja · Cross-site Scripting
Affects pallets jinjaSource CVE Database V5
Not known to be exploited · CVSS 5.4 Medium : upgrade to 3.1.3 when convenient.
Data as of 26 Oct 2026, 06:26 UTC
- EPSS
- 0.8% chance of exploitation in 30 days – higher than 59% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- 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
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-26.
What to do
Upgrade pallets jinja to 3.1.3.
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
The primary mitigation is to upgrade all affected Jinja instances to version 3.1.3 or later, where this vulnerability has been addressed. Organizations should audit their codebases and dependencies to identify usage of the `xmlattr` filter and review how input is passed to it. Avoid passing untrusted or user-supplied data directly to this filter without proper sanitization. Implement strict input validation and sanitization routines for any data rendered in templates, especially when using dynamic attribute generation. Employ Content Security Policy (CSP) headers to restrict the execution of unauthorized scripts and reduce the impact of potential XSS attacks. Additionally, security teams should conduct code reviews and penetration testing focused on template injection and XSS vectors. Monitoring web application logs for unusual or suspicious input patterns can help detect attempted exploitation. Finally, educate developers about secure template usage and the risks of improper input handling in templating engines.
Description
Jinja is an extensible templating engine. Special placeholders in the template allow writing code similar to Python syntax. It is possible to inject arbitrary HTML attributes into the rendered HTML template, potentially leading to Cross-Site Scripting (XSS). The Jinja `xmlattr` filter can be abused to inject arbitrary HTML attribute keys and values, bypassing the auto escaping mechanism and potentially leading to XSS. It may also be possible to bypass attribute validation checks if they are blacklist-based.
References
- github.com/pallets/jinja/security/advisories/GHSA-h5c8-rqwp-cp95 (opens in a new tab)
- github.com/pallets/jinja/releases/tag/3.1.3 (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5XCWZD464AJJJUBOO7CMPXQ4ROBC6JX2/ (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/01/msg00010.html (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/O7YWRBX6JQCWC2XXCTZ55C7DPMGICCN3/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DELCVUUYX75I5K4Q5WMJG4MUZJA6VAIP/ (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/12/msg00009.html (opens in a new tab)