Skip to content
OpenAdvisories

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 products

VendorProductAffectedFixed
pallets jinja < 3.1.4 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 jinja2 3.1.3-1.1 —
Debian 13 jinja2 3.1.3-1.1 —
Debian 12 jinja2 3.1.2-1+deb12u1 —
Debian 11 jinja2 2.11.3-1+deb11u1 DLA-3988-1
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS jinja2 3.1.2-1ubuntu1.1 USN-6787-1
Ubuntu 22.04 LTS jinja2 3.0.3-1ubuntu0.2 USN-6787-1
Ubuntu 20.04 LTS jinja2 2.10.1-2ubuntu0.3 USN-6787-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS jinja2 2.10-1ubuntu0.18.04.1+esm2 USN-6787-1
Ubuntu Pro 16.04 LTS jinja2 2.8-1ubuntu0.1+esm3 USN-6787-1
Ubuntu Pro 14.04 LTS jinja2 2.7.2-2ubuntu0.1~esm3 USN-6787-1
ReleasePackageFixed inAdvisory
RHEL 9 fence-virt +55 4.10.0-62.el9_4.3 RHSA-2024:3820
RHEL 9 python-jinja2 +1 2.11.3-6.el9 RHSA-2024:9150
RHEL 8 python-jinja2 +1 2.10.1-5.el8_10 RHSA-2024:4231
Show 17 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Red Hat Satellite Capsule 6 python-aiohttp +1 3.9.4-1.el8pc RHSA-2024:5662
Red Hat Satellite Capsule 6 python-django +1 4.2.14-1.el8pc RHSA-2024:5662
Red Hat Satellite Capsule 6 python-jinja2 +1 3.1.4-1.el8pc RHSA-2024:5662
Red Hat Satellite Capsule 6 python-pillow +1 10.3.0-1.el8pc RHSA-2024:5662
Red Hat Satellite 6 python-aiohttp +1 3.9.4-1.el8pc RHSA-2024:5662
Red Hat Satellite 6 python-django +1 4.2.14-1.el8pc RHSA-2024:5662
Red Hat Satellite 6 python-jinja2 +1 3.1.4-1.el8pc RHSA-2024:5662
Red Hat Satellite 6 python-pillow +1 10.3.0-1.el8pc RHSA-2024:5662
Red Hat Rhui 4 python-aiohttp +1 3.9.4-1.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-cryptography +1 42.0.8-1.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-django +1 4.2.15-1.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-grpcio +1 1.65.4-1.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-gunicorn +1 22.0.0-1.0.1.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-jinja2 +1 3.1.4-1.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-requests +1 2.32.3-2.el8ui RHSA-2025:1335
Red Hat Rhui 4 python-sqlparse +1 0.5.0-1.el8ui RHSA-2025:1335
RHEL 9.2 EUS fence-virt +55 4.10.0-43.el9_2.6 RHSA-2024:4427
RHEL 9.0 E4S fence-virt +56 4.10.0-20.el9_0.13 RHSA-2024:4414
RHEL 8.8 EUS fence-agents +47 4.2.1-112.el8_8.6 RHSA-2024:3811
RHEL 8.6 TUS fence-agents +45 4.2.1-89.el8_6.12 RHSA-2024:4404
RHEL 8.6 E4S fence-agents +45 4.2.1-89.el8_6.12 RHSA-2024:4404
RHEL 8.6 AUS fence-agents +41 4.2.1-89.el8_6.12 RHSA-2024:4404
RHEL 8.4 TUS fence-agents +45 4.2.1-65.el8_4.15 RHSA-2024:3795
RHEL 8.4 E4S fence-agents +45 4.2.1-65.el8_4.15 RHSA-2024:3795
RHEL 8.4 AUS fence-agents +45 4.2.1-65.el8_4.15 RHSA-2024:3795
Red Hat Openshift Ironic 4 python-jinja2 +1 3.0.1-3.el9.1 RHSA-2024:6011, RHSA-2024:5810, RHSA-2024:4958
Red Hat Openshift Ironic 4 python-werkzeug +1 2.0.3-6.el9 RHSA-2024:5810
Red Hat OpenShift 4 openshift +1 4.12.0-202408131833.p0.g1eb8682.assembly.stream.el8 RHSA-2024:5810
Red Hat OpenShift 4 openshift-clients +1 4.16.0-202407111006.p0.gfa84651.assembly.stream.el8 RHSA-2024:4616
Red Hat OpenShift 4 ose-aws-ecr-image-credential-provider 4.16.0-202407120242.p0.ga53e9de.assembly.stream.el8 RHSA-2024:4616
Red Hat OpenShift 4 ose-azure-acr-image-credential-provider 4.16.0-202407120242.p0.g0e95532.assembly.stream.el8 RHSA-2024:4616
Red Hat OpenShift 4 ose-gcp-gcr-image-credential-provider 4.16.0-202407120242.p0.g26b43df.assembly.stream.el8 RHSA-2024:4616
Red Hat OpenShift 4 skopeo +1 2:1.14.5-1.rhaos4.16.el8 RHSA-2024:4616
Red Hat Ansible Automation Platform Inside 2 python-black +1 22.8.0-2.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Inside 2 python-cryptography +1 42.0.5-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Inside 2 python-jinja2 +1 3.1.4-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Inside 2 python39-black +1 22.8.0-2.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Inside 2 python39-cryptography +1 42.0.5-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Inside 2 python39-jinja2 +1 3.1.4-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Inside 2 receptor +1 1.4.8-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python-black +1 22.8.0-2.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python-cryptography +1 42.0.5-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python-idna +1 3.7-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python-jinja2 +1 3.1.4-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python-requests +1 2.32.2-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python39-black +1 22.8.0-2.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python39-cryptography +1 42.0.5-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python39-idna +1 3.7-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python39-jinja2 +1 3.1.4-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 python39-requests +1 2.32.2-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform Developer 2 receptor +1 1.4.8-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 automation-controller-venv-tower 4.5.7-1.el8ap RHSA-2024:4522, RHSA-2024:3781
Red Hat Ansible Automation Platform 2 automation-hub +2 4.9.2-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-aiohttp +1 3.9.5-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-black +1 22.8.0-2.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-cryptography +1 42.0.5-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-galaxy-ng +1 4.9.2-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-gunicorn +1 22.0.0-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-idna +1 3.7-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-jinja2 +1 3.1.4-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-pillow +1 10.3.0-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-pydantic +1 1.10.15-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-requests +1 2.32.2-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-social-auth-app-django +1 5.4.1-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python-sqlparse +1 0.5.0-1.el9ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-aiohttp +1 3.9.5-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-black +1 22.8.0-2.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-cryptography +1 42.0.5-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-gunicorn +1 22.0.0-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-idna +1 3.7-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-jinja2 +1 3.1.4-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-pillow +1 10.3.0-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-pydantic +1 1.10.15-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-requests +1 2.32.2-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-social-auth-app-django +1 5.4.1-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 python39-sqlparse +1 0.5.0-1.el8ap RHSA-2024:3781
Red Hat Ansible Automation Platform 2 receptor +1 1.4.8-1.el8ap RHSA-2024:3781

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 fence-virt +54 4.10.0-62.el9_4.3 ALSA-2024:3820
AlmaLinux 9 python3-jinja2 2.11.3-6.el9 ALSA-2024:9150
AlmaLinux 8 python3-jinja2 2.10.1-5.el8_10 ALSA-2024:4231

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 fence-agents 4.10.0-62.el9_4.3 RLSA-2024:3820
Rocky Linux 9 python-jinja2 2.11.3-6.el9 RLSA-2024:9150
Rocky Linux 8 python-jinja2 2.10.1-5.el8_10 RLSA-2024:4231
ReleasePackageFixed inAdvisory
SLES 15 SP6 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
SLES 15 SP5 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
SLES 12 python-Jinja2 2.8-19.26.1 SUSE-SU-2024:1948-1
SLES 3 python-Jinja2 3.1.2-150400.12.6.1 SUSE-SU-2024:1864-1
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.0 python-Jinja2 3.1.2-6.1 SUSE-SU-2025:20035-1
SLE Micro 5.5 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-2, SUSE-SU-2024:1863-1
SLE Micro 5.4 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
SLE Micro 5.3 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
SLE Micro 5.2 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
SLE Micro 5.1 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
SUSE Manager Client Tools 12 python-Jinja2 2.8-19.26.1 SUSE-SU-2024:1948-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed python-Jinja2 3.1.4-1.1 openSUSE-SU-2026:11992-1, openSUSE-SU-2024:13930-1
openSUSE Leap 15.6 python-Jinja2 3.1.2-150400.12.6.1 SUSE-SU-2024:1864-1
openSUSE Leap 15.5 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1864-1, SUSE-SU-2024:1863-1
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
openSUSE Leap Micro 5.4 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
openSUSE Leap Micro 5.3 python-Jinja2 2.10.1-150000.3.13.1 SUSE-SU-2024:1863-1
ReleasePackageFixed inAdvisory
Alpine v3.24 py3-jinja2 3.1.4-r0 —
Alpine v3.23 py3-jinja2 3.1.4-r0 —
Alpine v3.22 py3-jinja2 3.1.4-r0 —
Alpine v3.21 py3-jinja2 3.1.4-r0 —
Alpine v3.20 py3-jinja2 3.1.4-r0 —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 py3-jinja2 3.1.4-r0 —
Alpine v3.18 py3-jinja2 3.1.4-r0 —
Alpine v3.17 py3-jinja2 3.1.4-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 ansible-core +1 2.15.3-1.amzn2023.0.4 ALAS2023-2024-644
Amazon Linux 2023 python3-jinja2 2.11.3-1.amzn2023.0.4 ALAS2023-2024-645
Amazon Linux 2 python-jinja2 2.7.2-3.amzn2.0.2 ALAS2-2024-2574
Amazon Linux 2 python3-jinja2 2.7.2-4.amzn2.0.4 ALAS2-2024-2573

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 nodejs 20.14.0-1 —
Azure Linux 3 nodejs24 24.13.0-1 —
Azure Linux 3 python-jinja2 3.1.2-2 —
Azure Linux 2 (CBL-Mariner) nodejs18 18.20.3-4 —
Azure Linux 2 (CBL-Mariner) python-jinja2 3.0.3-4 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 fence-virt +47 4.10.0-62.el9_4.3 ELSA-2024-3820
Oracle Linux 9 python3-jinja2 2.11.3-6.el9 ELSA-2024-9150
Oracle Linux 8 python3-jinja2 2.10.1-5.el8_10 ELSA-2024-4231

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling checkov 3.0.34-r1 —
Wolfi rolling confluent-docker-utils 0.0.77-r0 —
Wolfi rolling dask-gateway +1 2024.1.0-r4 —
Wolfi rolling kubeflow-jupyter-web-app 1.8.0-r7 —
Wolfi rolling kubeflow-pipelines-visualization-server 2.4.0-r0 —
Wolfi rolling kubeflow-volumes-web-app 1.8.0-r6 —
Wolfi rolling py3-jinja2 +5 3.1.4-r1 —
Wolfi rolling reflex 0.5.0-r0 —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 7 repositories

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI jinja2 < 3.1.4 3.1.4 GHSA-h75v-3vvj-5mfj

Advisories 50

References