Vulnerability · Published Dec 23, 2024 · Assigned by GitHub_M

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

Medium 5.4

In plain English

A medium-severity security flaw in jinja from pallets. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 24% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)5.4Medium
Exploit odds (30 days)0.3%top 76.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:9fence-agents-common4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-agents-compute4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-agents-ibm-powervs4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-agents-ibm-vpc4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-agents-kubevirt4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-agents-virsh4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virt4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virtd4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virtd-cpg4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virtd-libvirt4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virtd-multicast4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virtd-serial4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
AlmaLinux:9fence-virtd-tcp4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
Alpine:v3.20py3-jinja23.1.5-r0ALPINE-CVE-2024-56201
Alpine:v3.21py3-jinja23.1.5-r0ALPINE-CVE-2024-56201
Alpine:v3.22py3-jinja23.1.5-r0ALPINE-CVE-2024-56201
Alpine:v3.23py3-jinja23.1.5-r0ALPINE-CVE-2024-56201
Alpine:v3.24py3-jinja23.1.5-r0ALPINE-CVE-2024-56201
Debian:12jinja23.1.2-1+deb12u2DEBIAN-CVE-2024-56201
Debian:13jinja23.1.5-1DEBIAN-CVE-2024-56201
Debian:14jinja23.1.5-1DEBIAN-CVE-2024-56201
PyPIjinja23.1.5GHSA-gmj6-6f8f-6699
PyPIjinja23.1.5PYSEC-2026-1472
Ubuntu:22.04:LTSjinja23.0.3-1ubuntu0.4USN-7343-1
Ubuntu:22.04:LTSjinja23.0.3-1ubuntu0.3USN-7244-1
Ubuntu:22.04:LTSjinja23.0.3-1ubuntu0.3UBUNTU-CVE-2024-56201
Ubuntu:24.04:LTSjinja23.1.2-1ubuntu1.2UBUNTU-CVE-2024-56201
Ubuntu:24.04:LTSjinja23.1.2-1ubuntu1.2USN-7244-1
Ubuntu:24.04:LTSjinja23.1.2-1ubuntu1.3USN-7343-1

Affected products (as reported)

VendorProductVersions
pallets jinja >= 3.0.0, < 3.1.5

Weakness: CWE-150 · Vector: 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

References