Description
Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, a bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox is used. To exploit the vulnerability, an attacker needs to control both the filename and the contents of a template. Whether that is the case depends on the type of application using Jinja. This vulnerability impacts users of applications which execute untrusted templates where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pallets | jinja | >= 3.0.0, < 3.1.5 | — |
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.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | jinja2 | 3.1.5-1 | — |
| Debian 13 | jinja2 | 3.1.5-1 | — |
| Debian 12 | jinja2 | 3.1.2-1+deb12u2 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 24.04 LTS | jinja2 | 3.1.2-1ubuntu1.2 | USN-7343-1, USN-7244-1 |
| Ubuntu 22.04 LTS | jinja2 | 3.0.3-1ubuntu0.3 | USN-7343-1, USN-7244-1 |
| Ubuntu 20.04 LTS | jinja2 | 2.10.1-2ubuntu0.4 | USN-7343-1, USN-7244-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 18.04 LTS | jinja2 | 2.10-1ubuntu0.18.04.1+esm3 | USN-7343-1, USN-7244-1 |
| Ubuntu Pro 16.04 LTS | jinja2 | 2.8-1ubuntu0.1+esm5 | USN-7343-1 |
| Ubuntu Pro 14.04 LTS | jinja2 | 2.7.2-2ubuntu0.1~esm6 | USN-7343-1 |
Red Hat
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| RHEL 9 | fence-virt +55 | 4.10.0-76.el9_5.4 | RHSA-2025:0308 |
Show 11 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Red Hat Satellite Capsule 6 | python-jinja2 +1 | 3.1.5-1.el8pc | RHSA-2025:3491 |
| Red Hat Satellite Capsule 6 | rubygem-rack | 2.2.13-1.el8sat | RHSA-2025:3491 |
| Red Hat Satellite 6 | python-jinja2 +1 | 3.1.5-1.el8pc | RHSA-2025:3491 |
| Red Hat Satellite 6 | rubygem-graphql | 1.13.24-1.el8sat | RHSA-2025:3491 |
| Red Hat Satellite 6 | rubygem-rack | 2.2.13-1.el8sat | RHSA-2025:3491 |
| RHEL 9.4 EUS | fence-virt +55 | 4.10.0-62.el9_4.10 | RHSA-2025:0338 |
| RHEL 9.2 EUS | fence-virt +55 | 4.10.0-43.el9_2.11 | RHSA-2025:0335 |
| RHEL 9.0 E4S | fence-virt +56 | 4.10.0-20.el9_0.20 | RHSA-2025:0345 |
| Red Hat Openshift Ironic 4 | python-jinja2 +1 | 3.0.1-6.el9.2 | RHSA-2025:1130, RHSA-2025:1118, RHSA-2025:0842 |
| Red Hat Openshift Ironic 4 | python3-jinja2+i18n | 3.1.5-1.el9 | RHSA-2025:0656 |
| Red Hat OpenStack 17 | openstack-ansible-core | 2.14.2-4.6.el9ost | RHSA-2025:1861 |
| Red Hat OpenShift 4 | podman +6 | 4:4.9.4-13.rhaos4.16.el8 | RHSA-2025:0830 |
| Red Hat Ansible Automation Platform Inside 2 | python-jinja2 +1 | 3.1.5-1.el9ap | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform Inside 2 | python39-jinja2 +2 | 3.1.5-1.el8ap | RHSA-2025:0777, RHSA-2025:0721 |
| Red Hat Ansible Automation Platform Developer 2 | python-jinja2 +1 | 3.1.5-1.el9ap | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform Developer 2 | python3.11-django | 4.2.18-1.el8ap | RHSA-2025:0777 |
| Red Hat Ansible Automation Platform Developer 2 | python39-jinja2 +2 | 3.1.5-1.el8ap | RHSA-2025:0777, RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2 | automation-controller-venv-tower | 4.5.17-1.el8ap | RHSA-2025:0777, RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2 | python-jinja2 +1 | 3.1.5-1.el9ap | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2 | python3.11-django | 4.2.18-1.el8ap | RHSA-2025:0777 |
| Red Hat Ansible Automation Platform 2 | python39-jinja2 +2 | 3.1.5-1.el8ap | RHSA-2025:0777, RHSA-2025:0721 |
AlmaLinux
Errata ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux 9 | fence-virt +12 | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP5 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
| SLES 15 SP4 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
| SLES 3 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
Show 6 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 15 SP5 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
| SLES for SAP 15 SP4 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
| SLE Micro 6.1 | python-Jinja2 | 3.1.4-slfo.1.1_2.1 | SUSE-SU-2025:20254-1 |
| SLE Micro 6.0 | python-Jinja2 | 3.1.2-7.1 | SUSE-SU-2025:20117-1 |
| SLE HPC 15 SP5 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
| SLE HPC 15 SP4 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | oci-cli | 3.54.1-1.1 | openSUSE-SU-2025:14997-1 |
| openSUSE Leap 15.6 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
| openSUSE Leap 15.5 | python-Jinja2 | 3.1.2-150400.12.11.1 | SUSE-SU-2025:0006-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | py3-jinja2 | 3.1.5-r0 | — |
| Alpine v3.23 | py3-jinja2 | 3.1.5-r0 | — |
| Alpine v3.22 | py3-jinja2 | 3.1.5-r0 | — |
| Alpine v3.21 | py3-jinja2 | 3.1.5-r0 | — |
| Alpine v3.20 | py3-jinja2 | 3.1.5-r0 | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | py3-jinja2 | 3.1.5-r0 | — |
| Alpine v3.18 | py3-jinja2 | 3.1.5-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | ansible-core +1 | 2.15.3-1.amzn2023.0.5 | ALAS2023-2025-811 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | python-jinja2 | 3.1.2-2 | — |
| Azure Linux 2 (CBL-Mariner) | python-jinja2 | 3.0.3-5 | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | fence-virt +47 | 4.10.0-76.el9_5.4 | ELSA-2025-0308 |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | airflow | 2.10.4-r2 | — |
| Wolfi rolling | checkov | 3.2.432-r0 | — |
| Wolfi rolling | dask-gateway | 2024.1.0-r13 | — |
| Wolfi rolling | emissary +6 | 3.9.1-r8 | — |
| Wolfi rolling | kserve +9 | 0.14.1-r0 | — |
| Wolfi rolling | kubeflow-jupyter-web-app +1 | 1.9.2-r3 | — |
| Wolfi rolling | py3-jinja2 | 3.1.5-r0 | — |
| Wolfi rolling | reflex | 0.6.7-r0 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | jinja2 | >= 3.0.0, < 3.1.5 | 3.1.5 | GHSA-gmj6-6f8f-6699 |
Advisories 24
- ALSA-2025:0308 Important: fence-agents security update AlmaLinux Security Advisories · Oct 29, 2026
- RHSA-2025:3491 Red Hat Security Advisory: Satellite 6.15.5.2 Async Update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:1861 Red Hat Security Advisory: Red Hat OpenStack Platform 17.1.4 (openstack-ansible-core) security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:1130 Red Hat Security Advisory: OpenShift Container Platform 4.15.45 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:1118 Red Hat Security Advisory: OpenShift Container Platform 4.13.55 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0842 Red Hat Security Advisory: OpenShift Container Platform 4.14.46 security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0830 Red Hat Security Advisory: OpenShift Container Platform 4.16.33 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0834 Red Hat Security Advisory: OpenShift Container Platform 4.12.72 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0721 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0777 Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.5 Product Security and Bug Fix Update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0656 Red Hat Security Advisory: OpenShift Container Platform 4.17.14 packages and security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0345 Red Hat Security Advisory: fence-agents security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0338 Red Hat Security Advisory: fence-agents security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0308 Red Hat Security Advisory: fence-agents security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- RHSA-2025:0335 Red Hat Security Advisory: fence-agents security update Red Hat Security Advisories (RHSA) · Oct 16, 2026
- USN-7343-1 jinja2 vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- SUSE-SU-2025:20254-1 Security update for python-Jinja2 SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:20117-1 Security update for python-Jinja2 SUSE / openSUSE Security Updates · Mar 23, 2026
- USN-7244-1 jinja2 vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- openSUSE-SU-2025:14997-1 oci-cli-3.54.1-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:0006-1 Security update for python-Jinja2 SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2025-0054 Red Hat Enterprise Linux (Jinja): Mehrere Schwachstellen ermöglichen Codeausführung BSI CERT-Bund (WID) · Nov 26, 2025
- ALAS2023-2025-811 Important: ansible-core security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Jan 24, 2025
- ELSA-2025-0308 Important: fence-agents security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Jan 14, 2025