cve.bz

CVE-2024-34064 Cross-site Scripting

5.4 mediumEPSS 1.0%Fix available

Medium (5.4). EPSS 1.0% estimated probability of exploitation activity in the next 30 days. Fixed in jinja2 3.1.4.

On this page
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.

Severity

CVSS 3.1

5.4 medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
EPSS
1.0% (unchanged from 1.0% a week ago; 1.0% 30 days ago) estimated probability of exploitation activity in the next 30 days; 63rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-05-09. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-79 Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-34064 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-34064?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-34064?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-34064 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
palletsprojects:jinjabefore 3.1.4
fedoraproject:fedora39
fedoraproject:fedora40

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-h75v-3vvj-5mfjPyPIjinja2<3.1.43.1.4
PYSEC-2026-1474PyPIjinja2<3.1.43.1.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11jinja22.11.3-1+deb11u1DLA-3988-1
Debian12jinja23.1.2-1+deb12u1DEBIAN-CVE-2024-34064
Debian13, 14jinja23.1.3-1.1DEBIAN-CVE-2024-34064
Ubuntu20.04:LTSjinja22.10.1-2ubuntu0.3UBUNTU-CVE-2024-34064 USN-6787-1
Ubuntu22.04:LTSjinja23.0.3-1ubuntu0.2UBUNTU-CVE-2024-34064 USN-6787-1
Ubuntu24.04:LTSjinja23.1.2-1ubuntu1.1UBUNTU-CVE-2024-34064 USN-6787-1
UbuntuPro:14.04:LTSjinja22.7.2-2ubuntu0.1~esm3UBUNTU-CVE-2024-34064 USN-6787-1
UbuntuPro:16.04:LTSjinja22.8-1ubuntu0.1+esm3UBUNTU-CVE-2024-34064 USN-6787-1
UbuntuPro:18.04:LTSjinja22.10-1ubuntu0.18.04.1+esm2UBUNTU-CVE-2024-34064 USN-6787-1
Red Hatansible_automation_platform:2.4::el8automation-controller-venv-tower0:4.5.7-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8automation-controller-venv-tower0:4.5.8-1.el8apRHSA-2024:4522
Red Hatansible_automation_platform:2.4::el8automation-hub, python39-galaxy-ng, python3x-galaxy-ng0:4.9.2-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-aiohttp, python3x-aiohttp, python39-aiohttp-debuginfo and 1 more0:3.9.5-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-gunicorn, python3x-gunicorn0:22.0.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-pillow, python3x-pillow, python39-pillow-debuginfo and 1 more0:10.3.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-pydantic, python3x-pydantic0:1.10.15-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-social-auth-app-django, python3x-social-auth-app-django0:5.4.1-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8python39-sqlparse, python3x-sqlparse0:0.5.0-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8python39-idna, python3x-idna0:3.7-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8python39-requests, python3x-requests0:2.32.2-1.el8apRHSA-2024:3781
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-black, python3x-black0:22.8.0-2.el8apRHSA-2024:3781
61 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Micro 5.1, Linux Enterprise Micro 5.2, Linux Enterprise Micro 5.3 and 4 morepython-Jinja22.10.1-150000.3.13.1SUSE-SU-2024:1863-1
SUSELinux Enterprise Micro 5.5python-Jinja22.10.1-150000.3.13.1SUSE-SU-2024:1863-2
SUSELinux Enterprise Module for Advanced Systems Management 12, Linux Enterprise Module for Public Cloud 12, Manager Client Tools 12python-Jinja22.8-19.26.1SUSE-SU-2024:1948-1
SUSELinux Enterprise Module for Python 3 15 SP5, Linux Enterprise Module for Python 3 15 SP6python-Jinja23.1.2-150400.12.6.1SUSE-SU-2024:1864-1
SUSELinux Micro 6.0python-Jinja23.1.2-6.1SUSE-SU-2025:20035-1
openSUSELeap 15.5, Leap 15.6python-Jinja23.1.2-150400.12.6.1SUSE-SU-2024:1864-1
openSUSELeap 15.5, Leap Micro 5.3, Leap Micro 5.4python-Jinja22.10.1-150000.3.13.1SUSE-SU-2024:1863-1
openSUSETumbleweedpython-Jinja23.1.4-1.1openSUSE-SU-2024:13930-1
openSUSETumbleweedpython-Jinja23.1.6-2.4openSUSE-SU-2026:11992-1
AlmaLinux8python3-jinja22.10.1-5.el8_10ALSA-2024:4231
AlmaLinux9fence-virt, fence-virtd, fence-virtd-cpg and 52 more4.10.0-62.el9_4.3ALSA-2024:3820
AlmaLinux9python3-jinja22.11.3-6.el9ALSA-2024:9150
Rocky Linux8python-jinja20:2.10.1-5.el8_10RLSA-2024:4231
Rocky Linux9fence-agents0:4.10.0-62.el9_4.3RLSA-2024:3820
Rocky Linux9python-jinja20:2.11.3-6.el9RLSA-2024:9150
Alpinev3.17, v3.18, v3.19 and 5 morepy3-jinja23.1.4-r0ALPINE-CVE-2024-34064
Azure Linux2nodejs1818.20.3-4AZL-40444
Azure Linux2python-jinja23.0.3-4AZL-40439
Azure Linux3nodejs20.14.0-1AZL-40420
Azure Linux3nodejs2424.13.0-1AZL-75801
Azure Linux3python-jinja23.1.2-2AZL-40369
Alpaquita23, streampy3-jinja23.1.4-r0BELL-CVE-2024-34064

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

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_ as user input continues to be safe.

Fence agents on RHEL 8 has been fixed as a part of https://access.redhat.com/errata/RHBA-2024:4238

Red Hat's mitigation

Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.

ProductPackageStateAdvisory
Ironic content for Red Hat OpenShift Container Platform 4.12python-jinja2-0:3.0.1-3.el9.1Fixed 2024-08-29RHSA-2024:5810
Ironic content for Red Hat OpenShift Container Platform 4.13python-jinja2-0:3.0.1-3.el9.1Fixed 2024-09-04RHSA-2024:6011
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-jinja2-0:3.1.4-1.el8apFixed 2024-06-10RHSA-2024:3781
Red Hat Ansible Automation Platform 2.4 for RHEL 8automation-controller-0:4.5.8-1.el8apFixed 2024-07-12RHSA-2024:4522
Red Hat Ansible Automation Platform 2.4 for RHEL 9python-jinja2-0:3.1.4-1.el9apFixed 2024-06-10RHSA-2024:3781
Red Hat Ansible Automation Platform 2.4 for RHEL 9automation-controller-0:4.5.8-1.el9apFixed 2024-07-12RHSA-2024:4522
Red Hat Developer Hub 1.2 on RHEL 9rhdh/rhdh-hub-rhel9:1.2-105Fixed 2024-06-24RHEA-2024:4071
Red Hat Enterprise Linux 8python-jinja2-0:2.10.1-5.el8_10Fixed 2024-07-02RHSA-2024:4231
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportfence-agents-0:4.2.1-65.el8_4.15Fixed 2024-06-11RHSA-2024:3795
Red Hat Enterprise Linux 8.4 Telecommunications Update Servicefence-agents-0:4.2.1-65.el8_4.15Fixed 2024-06-11RHSA-2024:3795
Red Hat Ansible Automation Platform 1.2ansible-towerOut of support scope
Red Hat Ansible Automation Platform 2ansible-lintNot affected
Red Hat Ansible Automation Platform 2python3-jinja2Not affected
Red Hat Ansible Automation Platform 2python3x-ansible-compatNot affected
Red Hat Ansible Automation Platform 2python3x-django-lifecycleNot affected
Red Hat Ansible Automation Platform 2python-ansible-compatNot affected
Red Hat Ansible Automation Platform 2python-django-lifecycleNot affected
Red Hat Ceph Storage 5cephadm-ansibleOut of support scope
Red Hat Ceph Storage 6cephadm-ansibleWill not fix
Red Hat Ceph Storage 7cephNot affected
229 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-34064.

Attack patterns (CAPEC)

  • CAPEC-63 Cross-Site Scripting (XSS) Likelihood: High · Severity: Very High
  • CAPEC-85 AJAX Footprinting Likelihood: High · Severity: Low
  • CAPEC-209 XSS Using MIME Type Mismatch Severity: Medium
  • CAPEC-588 DOM-Based XSS Likelihood: High · Severity: Very High
  • CAPEC-591 Reflected XSS Likelihood: High · Severity: Very High
  • CAPEC-592 Stored XSS Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON