NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
MEDIUM severity

CVE-2024-34064 — jinja2

MEDIUMFix: pallets/jinja@0668239

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

Also known asGHSA-h75v-3vvj-5mfjPYSEC-2026-1474
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 9, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

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

via FIRST.org ↗
1.0%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs62th percentile — riskier than 62% of all scored CVEsHighest risk
0.34%0.80%1.27%1.73%0.8%1.0%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
🐍jinja2

Real-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

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIjinja2all versions3.1.4pip install --upgrade 'jinja2==3.1.4'

Affected Products

2 products · 3 configurations
OS
fedorafedoraproject
2 versions
3940
Application
jinjapalletsprojects
< 3.1.4
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    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.

  2. 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.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

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.

Red HatModerate

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_…

Workaround published by Red Hat
Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.
Source: Red Hat security advisory for CVE-2024-34064 (CC BY 4.0)
ProductFixed inAdvisory
Ironic content for Red Hat OpenShift Container Platform 4.12python-jinja2-0:3.0.1-3.el9.1RHSA-2024:5810
Ironic content for Red Hat OpenShift Container Platform 4.13python-jinja2-0:3.0.1-3.el9.1RHSA-2024:6011
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-jinja2-0:3.1.4-1.el8apRHSA-2024:3781
Red Hat Ansible Automation Platform 2.4 for RHEL 8automation-controller-0:4.5.8-1.el8apRHSA-2024:4522
Red Hat Developer Hub 1.2 on RHEL 9rhdh/rhdh-hub-rhel9:1.2-105RHEA-2024:4071
Red Hat Enterprise Linux 8python-jinja2-0:2.10.1-5.el8_10RHSA-2024:4231
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportfence-agents-0:4.2.1-65.el8_4.15RHSA-2024:3795
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportfence-agents-0:4.2.1-89.el8_6.12RHSA-2024:4404

Frequently Asked Questions

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 cons
O3 Security · Impact-Aware SCA

Is CVE-2024-34064 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2024-34064: jinja2 XSS — Fixed in 3.1.4