CVE-2024-34064 is a medium-severity (CVSS 5.4) Cross-site Scripting (XSS) vulnerability in jinja2. A fix is available for jinja2 — see the affected versions and patch details below.
Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-34064.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2024-34064 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,567 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
jinja2Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | jinja2 | all versions | 3.1.4pip install --upgrade 'jinja2==3.1.4' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for jinja2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update jinja2 to 3.1.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-34064 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2024-34064 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2024-34064. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
The fix for CVE-2024-22195 only addressed spaces, 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_…
| Product | Fixed in | Advisory |
|---|---|---|
| Ironic content for Red Hat OpenShift Container Platform 4.12 | python-jinja2-0:3.0.1-3.el9.1 | RHSA-2024:5810 |
| Ironic content for Red Hat OpenShift Container Platform 4.13 | python-jinja2-0:3.0.1-3.el9.1 | RHSA-2024:6011 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | python3x-jinja2-0:3.1.4-1.el8ap | RHSA-2024:3781 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | automation-controller-0:4.5.8-1.el8ap | RHSA-2024:4522 |
| Red Hat Developer Hub 1.2 on RHEL 9 | rhdh/rhdh-hub-rhel9:1.2-105 | RHEA-2024:4071 |
| Red Hat Enterprise Linux 8 | python-jinja2-0:2.10.1-5.el8_10 | RHSA-2024:4231 |
| Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support | fence-agents-0:4.2.1-65.el8_4.15 | RHSA-2024:3795 |
| Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support | fence-agents-0:4.2.1-89.el8_6.12 | RHSA-2024:4404 |
Frequently Asked Questions
Is CVE-2024-34064 in your dependencies?
O3 Security finds CVE-2024-34064 across PyPI dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.