CVE-2024-56201 json
Jinja has a sandbox breakout through malicious filenames
published 2024-12-23 22 mo ago modified 2026-09-10 1 mo ago also EUVD-2024-3585 , GHSA-gmj6-6f8f-6699 , PYSEC-2026-1472
- cvss
- 8.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 23%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi jinja2 3.1.5
- palletsprojects jinja 3.1.5
- pocoo jinja2 3.1.5
- jinja2 Debian 12 3.1.2-1+deb12u2
- jinja2 Debian 14, Debian 13 3.1.5-1
debian advisories DEBIAN-CVE-2024-56201
- jinja2 Ubuntu 20.04 LTS 2.10.1-2ubuntu0.4
- jinja2 Ubuntu 22.04 LTS 3.0.3-1ubuntu0.3
- jinja2 Ubuntu 24.04 LTS 3.1.2-1ubuntu1.2
- jinja2 Ubuntu Pro 14.04 LTS 2.7.2-2ubuntu0.1~esm6
- jinja2 Ubuntu Pro 16.04 LTS 2.8-1ubuntu0.1+esm5
- jinja2 Ubuntu Pro 18.04 LTS 2.10-1ubuntu0.18.04.1+esm3
ubuntu advisories UBUNTU-CVE-2024-56201
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
- rubygem-rack satellite capsule 6.15, satellite 6.15 2.2.13-1.el8sat
- python-jinja2 satellite capsule 6.15, satellite 6.15 3.1.5-1.el8pc
- rubygem-graphql satellite 6.15 1.13.24-1.el8sat
- python3.11-jinja2 satellite capsule 6.15, satellite 6.15 3.1.5-1.el8pc
- openstack-ansible-core openstack 17.1 2.14.2-4.6.el9ost
- python-jinja2 openshift ironic 4.16, openshift ironic 4.15, openshift ironic 4.14 +2 more 3.0.1-6.el9.2
- python3-jinja2 openshift ironic 4.15, openshift ironic 4.14, openshift ironic 4.13 +1 more 3.0.1-6.el9.2
- podman openshift 4.16 4:4.9.4-13.rhaos4.16.el8
red hat advisories RHSA-2025:3491RHSA-2025:1861RHSA-2025:1118RHSA-2025:1130RHSA-2025:0830RHSA-2025:0842
- python-Jinja2 Linux Micro 6.1 3.1.4-slfo.1.1_2.1
- python-Jinja2 Linux Micro 6.0 3.1.2-7.1
- python-Jinja2 SLES for SAP 15 SP5, SLES for SAP 15 SP4, SLES 15 SP5-LTSS +9 more 3.1.2-150400.12.11.1
suse advisories SUSE-SU-2025:20254-1SUSE-SU-2025:20117-1SUSE-SU-2025:0006-1
- oci-cli openSUSE Tumbleweed 3.54.1-1.1
opensuse advisories openSUSE-SU-2025:14997-1
- fence-virt AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-virtd AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-virtd-cpg AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-virtd-tcp AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-agents-virsh AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-virtd-serial AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-agents-common AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
- fence-virtd-libvirt AlmaLinux 9 4.10.0-76.el9_5.4.alma.1
almalinux advisories ALSA-2025:0308
- fence-agents Rocky Linux 9 4.10.0-76.el9_5.4
rocky linux advisories RLSA-2025:0308
- py3-jinja2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +4 more 3.1.5-r0
alpine advisories ALPINE-CVE-2024-56201
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 CBL-Mariner 2.0 3.0.3-5
- python-jinja2 Azure Linux 3.0 3.1.2-2
azure linux advisories AZL-54650AZL-54660
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-56201 updated cvss 7.3
jinja2: Jinja has a sandbox breakout through malicious filenames
-
Red Hat OpenShift Lightspeed lightspeed-service-api-rhel9affected: workaround, no fix available “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.”
-
Red Hat Ansible Automation Platform 1.2 ansible-tower Red Hat Enterprise Linux 6 python-jinja2affected: workaround, no fix planned “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.”
-
Red Hat Enterprise Linux AI (RHEL AI) bootc-amd-rhel9, bootc-intel-rhel9, bootc-nvidia-rhel9, bootc-azure-amd-rhel9, instructlab-amd-rhel9, bootc-aws-nvidia-rhel9, +5 more Red Hat OpenShift Container Platform 4 openshift4/ose-ovn-kubernetes, openshift4/ztp-site-generate-rhel8, openshift4/ose-ovn-kubernetes-microshift-rhel9 Red Hat OpenShift distributed tracing 3 opentelemetry-rhel8-operator, opentelemetry-collector-rhel8, opentelemetry-operator-bundle, opentelemetry-target-allocator-rhel8affected: workaround, no fix available, no fix planned “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.”
-
Red Hat Ansible Automation Platform Execution Environments ansible-automation-platform/ee-minimal-rhel8 2.17.7-3, ansible-automation-platform/ee-minimal-rhel8 2.17.8-3, ansible-automation-platform/ee-minimal-rhel8 2.18.1-3, ansible-automation-platform/ee-minimal-rhel8 2.18.2-3, ansible-automation-platform/ee-minimal-rhel9 2.17.8-4, ansible-automation-platform/ee-minimal-rhel9 2.18.1-4, +13 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:1101
-
Red Hat Discovery 1 for RHEL 9 discovery/discovery-ui-rhel9 1.12.0-1, discovery/discovery-server-rhel9 1.12.0-1fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:1249
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.12 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0834
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.13 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:1118
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.14 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0842
show 27 moreshow fewer
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.15 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:1130
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.16 python-jinja2 3.0.1-6.el9.2, python3-jinja2 3.0.1-6.el9.2fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0830
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.17 python-jinja2 3.1.5-1.el9, python3-jinja2 3.1.5-1.el9, python3-jinja2+i18n 3.1.5-1.el9fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0656
-
Red Hat Ironic content for Red Hat OpenShift Container Platform 4.18 crudini 0.9.3-4.el9, pysnmp 4.4.12-6.el9, python-ddt 1.6.0-1.el9, python-pbr 6.0.0-1.el9, python-amqp 5.0.6-1.el9, python-smi 0.3.4-10.el9, +323 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHEA-2024:6126
-
Red Hat Quay v3 quay/quay-rhel8 v3.10.8-6, quay/quay-rhel8 v3.11.8-4, quay/quay-rhel8 v3.12.7-5, quay/quay-rhel8 v3.13.3-6, quay/quay-rhel8 v3.9.10-7, quay/clair-rhel8 v3.10.8-1, +44 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHBA-2025:0250
-
Red Hat Ansible Automation Platform 2.4 for RHEL 8 python39-jinja2 3.1.5-1.el8ap, python3x-jinja2 3.1.5-1.el8ap, automation-controller-venv-tower 4.5.17-1.el8ap, ansible-automation-platform-24/lightspeed-rhel8-operator 2.4-33 Red Hat Ansible Automation Platform 2.4 for RHEL 9 python-jinja2 3.1.5-1.el9ap, python3-jinja2 3.1.5-1.el9ap, automation-controller-venv-tower 4.5.17-1.el9apfixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0721
-
Red Hat Ansible Automation Platform 2.5 for RHEL 8 python3.11-jinja2 3.1.5-1.el8ap, automation-controller-venv-tower 4.6.7-1.el8ap, ansible-automation-platform-25/lightspeed-rhel8 2.5.250107-1 Red Hat Ansible Automation Platform 2.5 for RHEL 9 python3.11-jinja2 3.1.5-1.el9ap, automation-controller-venv-tower 4.6.7-1.el9apfixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0777
-
Red Hat Developer Hub (RHDH) 1.4 rhdh 1.4-1737055846fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHBA-2025:0409
-
Red Hat Developer Hub 1.5 rhdhfixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:3374
-
Red Hat Enterprise Linux AppStream (v. 9) fence-virt 4.10.0-76.el9_5.4, fence-virtd 4.10.0-76.el9_5.4, fence-agents 4.10.0-76.el9_5.4, fence-virtd-cpg 4.10.0-76.el9_5.4, fence-virtd-tcp 4.10.0-76.el9_5.4, fence-agents-virsh 4.10.0-76.el9_5.4, +8 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0308
-
Red Hat Enterprise Linux AppStream E4S (v.9.0) fence-virt 4.10.0-20.el9_0.20, fence-virtd 4.10.0-20.el9_0.20, fence-agents 4.10.0-20.el9_0.20, fence-virtd-cpg 4.10.0-20.el9_0.20, fence-virtd-tcp 4.10.0-20.el9_0.20, fence-agents-virsh 4.10.0-20.el9_0.20, +9 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0345
-
Red Hat Enterprise Linux AppStream EUS (v.9.2) fence-virt 4.10.0-43.el9_2.11, fence-virtd 4.10.0-43.el9_2.11, fence-agents 4.10.0-43.el9_2.11, fence-virtd-cpg 4.10.0-43.el9_2.11, fence-virtd-tcp 4.10.0-43.el9_2.11, fence-agents-virsh 4.10.0-43.el9_2.11, +8 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0335
-
Red Hat Enterprise Linux AppStream EUS (v.9.4) fence-virt 4.10.0-62.el9_4.10, fence-virtd 4.10.0-62.el9_4.10, fence-agents 4.10.0-62.el9_4.10, fence-virtd-cpg 4.10.0-62.el9_4.10, fence-virtd-tcp 4.10.0-62.el9_4.10, fence-agents-virsh 4.10.0-62.el9_4.10, +8 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0338
-
Red Hat Enterprise Linux High Availability (v. 9) fence-agents-all 4.10.0-76.el9_5.4, fence-agents-apc 4.10.0-76.el9_5.4, fence-agents-aws 4.10.0-76.el9_5.4, fence-agents-eps 4.10.0-76.el9_5.4, fence-agents-gce 4.10.0-76.el9_5.4, fence-agents-rsa 4.10.0-76.el9_5.4, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0308
-
Red Hat Enterprise Linux High Availability E4S (v.9.0) fence-agents-all 4.10.0-20.el9_0.20, fence-agents-apc 4.10.0-20.el9_0.20, fence-agents-aws 4.10.0-20.el9_0.20, fence-agents-eps 4.10.0-20.el9_0.20, fence-agents-gce 4.10.0-20.el9_0.20, fence-agents-rsa 4.10.0-20.el9_0.20, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0345
-
Red Hat Enterprise Linux High Availability EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.11, fence-agents-apc 4.10.0-43.el9_2.11, fence-agents-aws 4.10.0-43.el9_2.11, fence-agents-eps 4.10.0-43.el9_2.11, fence-agents-gce 4.10.0-43.el9_2.11, fence-agents-rsa 4.10.0-43.el9_2.11, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0335
-
Red Hat Enterprise Linux High Availability EUS (v.9.4) fence-agents-all 4.10.0-62.el9_4.10, fence-agents-apc 4.10.0-62.el9_4.10, fence-agents-aws 4.10.0-62.el9_4.10, fence-agents-eps 4.10.0-62.el9_4.10, fence-agents-gce 4.10.0-62.el9_4.10, fence-agents-rsa 4.10.0-62.el9_4.10, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0338
-
Red Hat Enterprise Linux Resilient Storage (v. 9) fence-agents-all 4.10.0-76.el9_5.4, fence-agents-apc 4.10.0-76.el9_5.4, fence-agents-aws 4.10.0-76.el9_5.4, fence-agents-eps 4.10.0-76.el9_5.4, fence-agents-gce 4.10.0-76.el9_5.4, fence-agents-rsa 4.10.0-76.el9_5.4, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0308
-
Red Hat Enterprise Linux Resilient Storage EUS (v.9.2) fence-agents-all 4.10.0-43.el9_2.11, fence-agents-apc 4.10.0-43.el9_2.11, fence-agents-aws 4.10.0-43.el9_2.11, fence-agents-eps 4.10.0-43.el9_2.11, fence-agents-gce 4.10.0-43.el9_2.11, fence-agents-rsa 4.10.0-43.el9_2.11, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0335
-
Red Hat Enterprise Linux Resilient Storage EUS (v.9.4) fence-agents-all 4.10.0-62.el9_4.10, fence-agents-apc 4.10.0-62.el9_4.10, fence-agents-aws 4.10.0-62.el9_4.10, fence-agents-eps 4.10.0-62.el9_4.10, fence-agents-gce 4.10.0-62.el9_4.10, fence-agents-rsa 4.10.0-62.el9_4.10, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0338
-
Red Hat Enterprise Linux ResilientStorage E4S (v.9.0) fence-agents-all 4.10.0-20.el9_0.20, fence-agents-apc 4.10.0-20.el9_0.20, fence-agents-aws 4.10.0-20.el9_0.20, fence-agents-eps 4.10.0-20.el9_0.20, fence-agents-gce 4.10.0-20.el9_0.20, fence-agents-rsa 4.10.0-20.el9_0.20, +36 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0345
-
Red Hat OpenShift AI 2.16 rhoai v2.16.2-1742489233fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:3368
-
Red Hat OpenShift Container Platform 4.16 openshift4/ose-ansible-rhel9-operator v4.16.0-202501311735.p0.g2cb0020.assembly.stream.el9fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:1123
-
Red Hat OpenShift Container Platform 4.17 openshift4/ose-ansible-rhel9-operator v4.17.0-202501300634.p0.g9cb5839.assembly.stream.el9fixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:0875
-
Red Hat OpenShift Container Platform 4.18 cri-tools 1.31.1-3.el9, libreswan 4.6-3.el9_0.3, ovn24.09 24.09.2-14.el9fdp, perf 5.14.0-427.50.2.el9_4, rtla 5.14.0-427.50.2.el9_4, crun 1.19.1-2.rhaos4.18.el9, +166 morefixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHEA-2024:6126
-
Red Hat OpenStack Platform 17.1 openstack-ansible-core 2.14.2-4.6.el9ostfixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHSA-2025:1861
-
Red Hat OpenStack Services on OpenShift 18 python-jinja2 3.1.5-1.el9ost, python3-jinja2 3.1.5-1.el9ostfixed: vendor fix “To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.” RHBA-2025:3029
2 more fixed, 26 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
- total
- Assessed
- 22 mo ago
Exploit prediction
0.31% chance of exploitation in the next 30 days, higher than 23% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 4.0 | 5.4 | CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CNA | 4.0 | 5.4 | CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| OSV | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | jinja2 | >=3.0.0, <3.1.5 |
3.1.5 |
Affected products
- pallets jinja
Classification
- Weakness
-
- CWE-150 Improper Neutralization of Escape, Meta, or Control Sequences
References
-
github.com
/pallets/jinja/commit/767b23617628419ae3709ccfb02f9602ae9fe51f
web, patch
-
github.com
/pallets/jinja/security/advisories/GHSA-gmj6-6f8f-6699
web, vendor-advisory
-
github.com
/pallets/jinja/issues/1792
web, issue-tracking
-
github.com
/pallets/jinja/releases/tag/3.1.5
web, release-notes
-
nvd.nist.gov
/vuln/detail/CVE-2024-56201
advisory
-
github.com
/pallets/jinja
package
-
pypi.org
/project/jinja2
package
-
github.com
/advisories/GHSA-gmj6-6f8f-6699
advisory
Sources
- CVE List CVE-2024-56201
- GitHub Advisory GHSA-gmj6-6f8f-6699
- NVD CVE-2024-56201
- OSV PYSEC-2026-1472
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.