CVE-2024-56201Jinja has a sandbox breakout through malicious filenames
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.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, PyPI, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 24.04 | jinja2 | Fixed | 3.1.2-1ubuntu1.2 | UBUNTU-CVE-2024-56201 |
| Ubuntu 22.04 | jinja2 | Fixed | 3.0.3-1ubuntu0.3 | UBUNTU-CVE-2024-56201 |
| Ubuntu 20.04 | jinja2 | Fixed | 2.10.1-2ubuntu0.4 | UBUNTU-CVE-2024-56201 |
| Ubuntu 18.04 | jinja2 | Fix pending | 2.10-1ubuntu0.18.04.1+esm3 (Ubuntu Pro) | UBUNTU-CVE-2024-56201 |
| Ubuntu 16.04 | jinja2 | Fix pending | 2.8-1ubuntu0.1+esm5 (Ubuntu Pro) | UBUNTU-CVE-2024-56201 |
| Ubuntu 14.04 | jinja2 | Fix pending | 2.7.2-2ubuntu0.1~esm6 (Ubuntu Pro) | UBUNTU-CVE-2024-56201 |
| Debian 14 | jinja2 | Fixed | 3.1.5-1 | DEBIAN-CVE-2024-56201 |
| Debian 13 | jinja2 | Fixed | 3.1.5-1 | DEBIAN-CVE-2024-56201 |
| Debian 12 | jinja2 | Fixed | 3.1.2-1+deb12u2 | DEBIAN-CVE-2024-56201 |
| Red Hat Enterprise Linux 10 | flatpak-sdk-container | Not affected | ||
| Red Hat Enterprise Linux 10 | python-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 10 | python3-jinja2+i18n | Not affected | ||
| Red Hat Enterprise Linux 9 | fence-agents | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-aliyun | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-all | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-amt-ws | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-apc | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-apc-snmp | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-aws | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-azure-arm | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-bladecenter | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-brocade | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-cisco-mds | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-cisco-ucs | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-common | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-compute | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-drac5 | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-eaton-snmp | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-emerson | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-eps | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-gce | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-heuristics-ping | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-hpblade | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ibm-powervs | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ibm-vpc | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ibmblade | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ifmib | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ilo-moonshot | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ilo-mp | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ilo-ssh | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ilo2 | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-intelmodular | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ipdu | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-ipmilan | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-kdump | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-kubevirt | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-lpar | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-mpath | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-openstack | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-redfish | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-rhevm | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-rsa | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-rsb | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-sbd | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-scsi | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-virsh | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-vmware-rest | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-vmware-soap | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-wti | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-agents-zvm | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virt | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virtd | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virtd-cpg | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virtd-libvirt | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virtd-multicast | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virtd-serial | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | fence-virtd-tcp | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | ha-cloud-support | Fixed | 0:4.10.0-76.el9_5.4 | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | keylime-registrar-container | Not affected | ||
| Red Hat Enterprise Linux 9 | python-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 9 | python3-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 8 | python-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 8 | python3-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 7 | python-jinja2 | Not affected | ||
| Red Hat Enterprise Linux 6 | python-jinja2 | Will not fix Out of support scope | ||
| AlmaLinux 9 | fence-agents-common | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-agents-compute | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-agents-ibm-powervs | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-agents-ibm-vpc | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-agents-kubevirt | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-agents-virsh | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virt | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virtd | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virtd-cpg | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virtd-libvirt | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virtd-multicast | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virtd-serial | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| AlmaLinux 9 | fence-virtd-tcp | Fixed | 4.10.0-76.el9_5.4.alma.1 | ALSA-2025:0308 |
| Rocky Linux 9 | fence-agents | Fixed | 0:4.10.0-76.el9_5.4 | RLSA-2025:0308 |
| Alpine Linux 3.24 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| Alpine Linux 3.23 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| Alpine Linux 3.22 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| Alpine Linux 3.21 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| Alpine Linux 3.20 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| Alpine Linux 3.19 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| Alpine Linux 3.18 | py3-jinja2 | Fixed | 3.1.5-r0 | ALPINE-CVE-2024-56201 |
| PyPI library | jinja2 | Fixed | 3.1.5 | GHSA-gmj6-6f8f-6699 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- pallets jinja: affected: >= 3.0.0, < 3.1.5
References
- https://github.com/pallets/jinja/security/advisories/GHSA-gmj6-6f8f-6699
- https://github.com/pallets/jinja/issues/1792
- https://github.com/pallets/jinja/commit/767b23617628419ae3709ccfb02f9602ae9fe51f
- https://github.com/pallets/jinja/releases/tag/3.1.5
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.