CVE-2024-34064 json
Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
published 2024-05-06 2 y ago modified 2026-09-10 1 mo ago also EUVD-2024-1641 , GHSA-h75v-3vvj-5mfj , PYSEC-2026-1474
- cvss
- 5.4
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.0%
- EPSS 1.0% chance of exploitation in 30 days, percentile 62%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi jinja2 3.1.4
- palletsprojects jinja 3.1.4
- jinja2 Debian 12 3.1.2-1+deb12u1
- jinja2 Debian 14, Debian 13 3.1.3-1.1
debian advisories DEBIAN-CVE-2024-34064
- jinja2 Ubuntu 20.04 LTS 2.10.1-2ubuntu0.3
- jinja2 Ubuntu 22.04 LTS 3.0.3-1ubuntu0.2
- jinja2 Ubuntu 24.04 LTS 3.1.2-1ubuntu1.1
- jinja2 Ubuntu Pro 14.04 LTS 2.7.2-2ubuntu0.1~esm3
- jinja2 Ubuntu Pro 16.04 LTS 2.8-1ubuntu0.1+esm3
- jinja2 Ubuntu Pro 18.04 LTS 2.10-1ubuntu0.18.04.1+esm2
ubuntu advisories UBUNTU-CVE-2024-34064
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-django rhui 4 4.2.15-1.el8ui
- python-grpcio rhui 4 1.65.4-1.el8ui
- python-jinja2 rhui 4 3.1.4-1.el8ui
- python-aiohttp rhui 4 3.9.4-1.el8ui
- python-gunicorn rhui 4 22.0.0-1.0.1.el8ui
- python-requests rhui 4 2.32.3-2.el8ui
- python-sqlparse rhui 4 0.5.0-1.el8ui
- python3.11-django rhui 4 4.2.15-1.el8ui
red hat advisories RHSA-2025:1335RHSA-2024:9150RHSA-2024:5810RHSA-2024:3781RHSA-2024:4616RHSA-2024:6011
- python-Jinja2 Linux Micro 6.0 3.1.2-6.1
- python-Jinja2 SLE Module for Public Cloud 12, SLE Module for Advanced Systems Management 12, Manager Client Tools 12 2.8-19.26.1
- python-Jinja2 SLE Module for Python 3 15 SP6, SLE Module for Python 3 15 SP5, openSUSE Leap 15.6 +1 more 3.1.2-150400.12.6.1
- python-Jinja2 SLE Module for Basesystem 15 SP6, SLE Module for Basesystem 15 SP5, SLE Micro 5.5 +7 more 2.10.1-150000.3.13.1
suse advisories SUSE-SU-2025:20035-1SUSE-SU-2024:1948-1SUSE-SU-2024:1864-1SUSE-SU-2024:1863-2SUSE-SU-2024:1863-1
- python-Jinja2 openSUSE Tumbleweed 3.1.6-2.4
- python-Jinja2 openSUSE Tumbleweed 3.1.4-1.1
opensuse advisories openSUSE-SU-2026:11992-1openSUSE-SU-2024:13930-1
- python3-jinja2 AlmaLinux 9 2.11.3-6.el9
- python3-jinja2 AlmaLinux 8 2.10.1-5.el8_10
- fence-virt AlmaLinux 9 4.10.0-62.el9_4.3
- fence-virtd AlmaLinux 9 4.10.0-62.el9_4.3
- fence-virtd-cpg AlmaLinux 9 4.10.0-62.el9_4.3
- fence-virtd-tcp AlmaLinux 9 4.10.0-62.el9_4.3
- fence-agents-all AlmaLinux 9 4.10.0-62.el9_4.3
- fence-agents-apc AlmaLinux 9 4.10.0-62.el9_4.3
almalinux advisories ALSA-2024:9150ALSA-2024:4231ALSA-2024:3820
- python-jinja2 Rocky Linux 9 2.11.3-6.el9
- python-jinja2 Rocky Linux 8 2.10.1-5.el8_10
- fence-agents Rocky Linux 9 4.10.0-62.el9_4.3
rocky linux advisories RLSA-2024:9150RLSA-2024:4231RLSA-2024:3820
- py3-jinja2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +5 more 3.1.4-r0
alpine advisories ALPINE-CVE-2024-34064
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- python-jinja2 Azure Linux 3.0 3.1.2-2
- nodejs Azure Linux 3.0 20.14.0-1
- python-jinja2 CBL-Mariner 2.0 3.0.3-4
- nodejs18 CBL-Mariner 2.0 18.20.3-4
- nodejs24 Azure Linux 3.0 24.13.0-1
azure linux advisories AZL-40369AZL-40420AZL-40439AZL-40444AZL-75801
Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-34064 updated cvss 5.4
jinja2: accepts keys containing non-attribute characters
-
Red Hat Ansible Automation Platform 1.2 ansible-tower Red Hat Ceph Storage 5 cephadm-ansible Red Hat Ceph Storage 6 cephadm-ansible Red Hat Enterprise Linux 6 python-jinja2 Red Hat Enterprise Linux 7 python-jinja2affected: workaround, no fix planned “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.”
-
Red Hat Enterprise Linux 8 fence-agents, python-jinja2, python3-jinja2, fence-agents-all, fence-agents-apc, fence-agents-aws, +45 moreaffected: workaround, no fix available, no fix planned “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.”
-
Red Hat OpenShift Container Platform 4 openshift4/ztp-site-generate-rhel8 Red Hat OpenStack Platform 18.0 python-httpcore Red Hat Quay 3 quay/quay-rhel8affected: workaround, no fix available “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.”
-
Red Hat Software Collections rh-python38-python-jinja2 Red Hat Storage 3 gdeployaffected: workaround, no fix planned “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.”
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.12 python-jinja2 3.0.1-3.el9.1, python3-jinja2 3.0.1-3.el9.1fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:5810
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.13 python-jinja2 3.0.1-3.el9.1, python3-jinja2 3.0.1-3.el9.1fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:6011
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.15 python-jinja2 3.0.1-3.el9.1, python3-jinja2 3.0.1-3.el9.1fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4958
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.16 python-jinja2 3.0.1-3.el9.1, python3-jinja2 3.0.1-3.el9.1fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4616
show 23 moreshow fewer
-
Red Hat Ansible Automation Platform 2.4 for RHEL 8 python39-jinja2 3.1.4-1.el8ap, python3x-jinja2 3.1.4-1.el8ap, automation-controller-venv-tower 4.5.8-1.el8ap Red Hat Ansible Automation Platform 2.4 for RHEL 9 python-jinja2 3.1.4-1.el9ap, python3-jinja2 3.1.4-1.el9ap, automation-controller-venv-tower 4.5.8-1.el9apfixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3781
-
Red Hat Developer Hub 1.2 for RHEL 9 rhdh/rhdh-hub-rhel9 1.2-105fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHEA-2024:4071
-
Red Hat Enterprise Linux AppStream (v. 8) python-jinja2 2.10.1-5.el8_10, python3-jinja2 2.10.1-5.el8_10fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4231
-
Red Hat Enterprise Linux AppStream (v. 9) python-jinja2 2.11.3-6.el9, python3-jinja2 2.11.3-6.el9, fence-virt 4.10.0-62.el9_4.3, fence-virtd 4.10.0-62.el9_4.3, fence-agents 4.10.0-62.el9_4.3, fence-virtd-cpg 4.10.0-62.el9_4.3, +10 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3820
-
Red Hat Enterprise Linux AppStream AUS (v.8.4) fence-agents 4.2.1-65.el8_4.15, fence-agents-all 4.2.1-65.el8_4.15, fence-agents-apc 4.2.1-65.el8_4.15, fence-agents-eps 4.2.1-65.el8_4.15, fence-agents-rsa 4.2.1-65.el8_4.15, fence-agents-rsb 4.2.1-65.el8_4.15, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3795
-
Red Hat Enterprise Linux AppStream AUS (v.8.6) fence-agents 4.2.1-89.el8_6.12, fence-agents-all 4.2.1-89.el8_6.12, fence-agents-apc 4.2.1-89.el8_6.12, fence-agents-eps 4.2.1-89.el8_6.12, fence-agents-rsa 4.2.1-89.el8_6.12, fence-agents-rsb 4.2.1-89.el8_6.12, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4404
-
Red Hat Enterprise Linux AppStream E4S (v.8.4) fence-agents 4.2.1-65.el8_4.15, fence-agents-all 4.2.1-65.el8_4.15, fence-agents-apc 4.2.1-65.el8_4.15, fence-agents-eps 4.2.1-65.el8_4.15, fence-agents-rsa 4.2.1-65.el8_4.15, fence-agents-rsb 4.2.1-65.el8_4.15, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3795
-
Red Hat Enterprise Linux AppStream E4S (v.8.6) fence-agents 4.2.1-89.el8_6.12, fence-agents-all 4.2.1-89.el8_6.12, fence-agents-apc 4.2.1-89.el8_6.12, fence-agents-eps 4.2.1-89.el8_6.12, fence-agents-rsa 4.2.1-89.el8_6.12, fence-agents-rsb 4.2.1-89.el8_6.12, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4404
-
Red Hat Enterprise Linux AppStream E4S (v.9.0) fence-virt 4.10.0-20.el9_0.13, fence-virtd 4.10.0-20.el9_0.13, fence-agents 4.10.0-20.el9_0.13, fence-virtd-cpg 4.10.0-20.el9_0.13, fence-virtd-tcp 4.10.0-20.el9_0.13, fence-agents-virsh 4.10.0-20.el9_0.13, +9 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4414
-
Red Hat Enterprise Linux AppStream EUS (v.8.8) fence-agents 4.2.1-112.el8_8.6, fence-agents-all 4.2.1-112.el8_8.6, fence-agents-apc 4.2.1-112.el8_8.6, fence-agents-eps 4.2.1-112.el8_8.6, fence-agents-rsa 4.2.1-112.el8_8.6, fence-agents-rsb 4.2.1-112.el8_8.6, +37 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3811
-
Red Hat Enterprise Linux AppStream EUS (v.9.2) fence-virt 4.10.0-43.el9_2.6, fence-virtd 4.10.0-43.el9_2.6, fence-agents 4.10.0-43.el9_2.6, fence-virtd-cpg 4.10.0-43.el9_2.6, fence-virtd-tcp 4.10.0-43.el9_2.6, fence-agents-virsh 4.10.0-43.el9_2.6, +8 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4427
-
Red Hat Enterprise Linux AppStream TUS (v.8.4) fence-agents 4.2.1-65.el8_4.15, fence-agents-all 4.2.1-65.el8_4.15, fence-agents-apc 4.2.1-65.el8_4.15, fence-agents-eps 4.2.1-65.el8_4.15, fence-agents-rsa 4.2.1-65.el8_4.15, fence-agents-rsb 4.2.1-65.el8_4.15, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3795
-
Red Hat Enterprise Linux AppStream TUS (v.8.6) fence-agents 4.2.1-89.el8_6.12, fence-agents-all 4.2.1-89.el8_6.12, fence-agents-apc 4.2.1-89.el8_6.12, fence-agents-eps 4.2.1-89.el8_6.12, fence-agents-rsa 4.2.1-89.el8_6.12, fence-agents-rsb 4.2.1-89.el8_6.12, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4404
-
Red Hat Enterprise Linux High Availability AUS (v.8.4) fence-agents-aws 4.2.1-65.el8_4.15, fence-agents-gce 4.2.1-65.el8_4.15, fence-agents-aliyun 4.2.1-65.el8_4.15, fence-agents-azure-arm 4.2.1-65.el8_4.15fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3795
-
Red Hat Enterprise Linux High Availability E4S (v.8.6) fence-agents-aws 4.2.1-89.el8_6.12, fence-agents-gce 4.2.1-89.el8_6.12, fence-agents-aliyun 4.2.1-89.el8_6.12, fence-agents-azure-arm 4.2.1-89.el8_6.12fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4404
-
Red Hat Enterprise Linux High Availability E4S (v.9.0) fence-agents-all 4.10.0-20.el9_0.13, fence-agents-apc 4.10.0-20.el9_0.13, fence-agents-aws 4.10.0-20.el9_0.13, fence-agents-eps 4.10.0-20.el9_0.13, fence-agents-gce 4.10.0-20.el9_0.13, fence-agents-rsa 4.10.0-20.el9_0.13, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4414
-
Red Hat Enterprise Linux High Availability EUS (v.8.8) fence-agents-aws 4.2.1-112.el8_8.6, fence-agents-gce 4.2.1-112.el8_8.6, fence-agents-aliyun 4.2.1-112.el8_8.6, fence-agents-azure-arm 4.2.1-112.el8_8.6, fence-agents-openstack 4.2.1-112.el8_8.6fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3811
-
Red Hat Enterprise Linux High Availability EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.6, fence-agents-apc 4.10.0-43.el9_2.6, fence-agents-aws 4.10.0-43.el9_2.6, fence-agents-eps 4.10.0-43.el9_2.6, fence-agents-gce 4.10.0-43.el9_2.6, fence-agents-rsa 4.10.0-43.el9_2.6, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4427
-
Red Hat Enterprise Linux High Availability TUS (v.8.6) fence-agents-aws 4.2.1-89.el8_6.12, fence-agents-gce 4.2.1-89.el8_6.12, fence-agents-aliyun 4.2.1-89.el8_6.12, fence-agents-azure-arm 4.2.1-89.el8_6.12fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4404
-
Red Hat Enterprise Linux HighAvailability (v. 9) fence-agents-all 4.10.0-62.el9_4.3, fence-agents-apc 4.10.0-62.el9_4.3, fence-agents-aws 4.10.0-62.el9_4.3, fence-agents-eps 4.10.0-62.el9_4.3, fence-agents-gce 4.10.0-62.el9_4.3, fence-agents-rsa 4.10.0-62.el9_4.3, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3820
-
Red Hat Enterprise Linux HighAvailability E4S (v.8.4) fence-agents-aws 4.2.1-65.el8_4.15, fence-agents-gce 4.2.1-65.el8_4.15, fence-agents-aliyun 4.2.1-65.el8_4.15, fence-agents-azure-arm 4.2.1-65.el8_4.15 Red Hat Enterprise Linux HighAvailability TUS (v.8.4) fence-agents-aws 4.2.1-65.el8_4.15, fence-agents-gce 4.2.1-65.el8_4.15, fence-agents-aliyun 4.2.1-65.el8_4.15, fence-agents-azure-arm 4.2.1-65.el8_4.15fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3795
-
Red Hat Enterprise Linux Resilient Storage EUS (v.8.8) fence-agents-aws 4.2.1-112.el8_8.6, fence-agents-gce 4.2.1-112.el8_8.6, fence-agents-aliyun 4.2.1-112.el8_8.6, fence-agents-azure-arm 4.2.1-112.el8_8.6, fence-agents-openstack 4.2.1-112.el8_8.6fixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:3811
-
Red Hat Enterprise Linux Resilient Storage EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.6, fence-agents-apc 4.10.0-43.el9_2.6, fence-agents-aws 4.10.0-43.el9_2.6, fence-agents-eps 4.10.0-43.el9_2.6, fence-agents-gce 4.10.0-43.el9_2.6, fence-agents-rsa 4.10.0-43.el9_2.6, +36 morefixed: vendor fix “Do not accept user input as keys to the xmlattr filter without validation. See the statement above for more information.” RHSA-2024:4427
5 more fixed, 22 more not affected in the full advisory
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.98% chance of exploitation in the next 30 days, higher than 62% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| CISA ADP | 3.1 | 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| GitHub | 3.1 | 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| OSV | 3.1 | 5.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | jinja2 | <3.1.4 |
3.1.4 |
Affected products
- pallets jinja
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/pallets/jinja/commit/0668239dc6b44ef38e7a6c9f91f312fd4ca581cb
web, patch
-
github.com
/pallets/jinja/security/advisories/GHSA-h75v-3vvj-5mfj
web, vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS/
mailing-list
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE/
mailing-list
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS/
mailing-list
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC/
mailing-list
-
lists.debian.org
/debian-lts-announce/2024/12/msg00009.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-34064
advisory
-
github.com
/pallets/jinja
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/567XIGSZMABG6TSMYWD7MIYNJSUQQRUC
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/GCLF44KY43BSVMTE6S53B4V5WP3FRRSE
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/SSCBHIL6BYKR5NRCBXP4XMP2CEEKGFVS
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/ZALNWE3TXPPHVPSI3AZ5CTMSTAVN5UMS
web
-
pypi.org
/project/jinja2
package
-
github.com
/advisories/GHSA-h75v-3vvj-5mfj
advisory
Sources
- CVE List CVE-2024-34064
- GitHub Advisory GHSA-h75v-3vvj-5mfj
- NVD CVE-2024-34064
- OSV PYSEC-2026-1474
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.