Skip to content
OpenAdvisories

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

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

ReleasePackageFixed inAdvisory
Debian 14 jinja2 3.1.5-1 —
Debian 13 jinja2 3.1.5-1 —
Debian 12 jinja2 3.1.2-1+deb12u2 —
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
RHEL 9 fence-virt +55 4.10.0-76.el9_5.4 RHSA-2025:0308
Show 11 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
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 ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 fence-virt +12 4.10.0-76.el9_5.4.alma.1 ALSA-2025:0308
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
Alpine v3.19 py3-jinja2 3.1.5-r0 —
Alpine v3.18 py3-jinja2 3.1.5-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 ansible-core +1 2.15.3-1.amzn2023.0.5 ALAS2023-2025-811

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 python-jinja2 3.1.2-2 —
Azure Linux 2 (CBL-Mariner) python-jinja2 3.0.3-5 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 fence-virt +47 4.10.0-76.el9_5.4 ELSA-2025-0308

Wolfi

ReleasePackageFixed inAdvisory
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

EcosystemPackageAffectedFixedRecord
PyPI jinja2 >= 3.0.0, < 3.1.5 3.1.5 GHSA-gmj6-6f8f-6699

Advisories 24

References