CVEfocus › CVE database › CVE-2024-56201

CVE-2024-56201Jinja has a sandbox breakout through malicious filenames

CVSS 5.4 MediumEPSS 0.4% (higher than 23% of CVEs)Published 2024-12-23Updated 2025-02-18Assigner: GitHub_M

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.

CWE-150

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

84Fixed
3Fix pending
1Will not fix
10Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04jinja2Fixed3.1.2-1ubuntu1.2UBUNTU-CVE-2024-56201
Ubuntu 22.04jinja2Fixed3.0.3-1ubuntu0.3UBUNTU-CVE-2024-56201
Ubuntu 20.04jinja2Fixed2.10.1-2ubuntu0.4UBUNTU-CVE-2024-56201
Ubuntu 18.04jinja2Fix pending2.10-1ubuntu0.18.04.1+esm3 (Ubuntu Pro)UBUNTU-CVE-2024-56201
Ubuntu 16.04jinja2Fix pending2.8-1ubuntu0.1+esm5 (Ubuntu Pro)UBUNTU-CVE-2024-56201
Ubuntu 14.04jinja2Fix pending2.7.2-2ubuntu0.1~esm6 (Ubuntu Pro)UBUNTU-CVE-2024-56201
Debian 14jinja2Fixed3.1.5-1DEBIAN-CVE-2024-56201
Debian 13jinja2Fixed3.1.5-1DEBIAN-CVE-2024-56201
Debian 12jinja2Fixed3.1.2-1+deb12u2DEBIAN-CVE-2024-56201
Red Hat Enterprise Linux 10flatpak-sdk-containerNot affected
Red Hat Enterprise Linux 10python-jinja2Not affected
Red Hat Enterprise Linux 10python3-jinja2Not affected
Red Hat Enterprise Linux 10python3-jinja2+i18nNot affected
Red Hat Enterprise Linux 9fence-agentsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-aliyunFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-allFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-amt-wsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-apcFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-apc-snmpFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-awsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-azure-armFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-bladecenterFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-brocadeFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-cisco-mdsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-cisco-ucsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-commonFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-computeFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-drac5Fixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-eaton-snmpFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-emersonFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-epsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-gceFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-heuristics-pingFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-hpbladeFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ibm-powervsFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ibm-vpcFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ibmbladeFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ifmibFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ilo-moonshotFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ilo-mpFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ilo-sshFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ilo2Fixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-intelmodularFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ipduFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-ipmilanFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-kdumpFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-kubevirtFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-lparFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-mpathFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-openstackFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-redfishFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-rhevmFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-rsaFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-rsbFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-sbdFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-scsiFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-virshFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-vmware-restFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-vmware-soapFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-wtiFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-agents-zvmFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtdFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtd-cpgFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtd-libvirtFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtd-multicastFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtd-serialFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9fence-virtd-tcpFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9ha-cloud-supportFixed0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hat Enterprise Linux 9keylime-registrar-containerNot affected
Red Hat Enterprise Linux 9python-jinja2Not affected
Red Hat Enterprise Linux 9python3-jinja2Not affected
Red Hat Enterprise Linux 8python-jinja2Not affected
Red Hat Enterprise Linux 8python3-jinja2Not affected
Red Hat Enterprise Linux 7python-jinja2Not affected
Red Hat Enterprise Linux 6python-jinja2Will not fix
Out of support scope
AlmaLinux 9fence-agents-commonFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-agents-computeFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-agents-ibm-powervsFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-agents-ibm-vpcFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-agents-kubevirtFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-agents-virshFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtdFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtd-cpgFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtd-libvirtFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtd-multicastFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtd-serialFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux 9fence-virtd-tcpFixed4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
Rocky Linux 9fence-agentsFixed0:4.10.0-76.el9_5.4RLSA-2025:0308
Alpine Linux 3.24py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
Alpine Linux 3.23py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
Alpine Linux 3.22py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
Alpine Linux 3.21py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
Alpine Linux 3.20py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
Alpine Linux 3.19py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
Alpine Linux 3.18py3-jinja2Fixed3.1.5-r0ALPINE-CVE-2024-56201
PyPI libraryjinja2Fixed3.1.5GHSA-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.

References

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.