cve.bz

CVE-2024-56201 palletsprojects jinja

5.4 mediumEPSS 0.3%Fix available

Medium (5.4) in palletsprojects jinja. EPSS 0.3% estimated probability of exploitation activity in the next 30 days. Fixed in jinja2 3.1.5.

On this page
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.

Severity

CVSS 4.0

5.4 medium
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

CVSS 3.1

8.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS
0.3% (unchanged from 0.3% a week ago; 0.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 24th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2024-12-24. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-150 Improper Neutralization of Escape, Meta, or Control Sequences
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-56201 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-56201?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-56201?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-56201 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
palletsprojects:jinjafrom 3.0.0 before 3.1.5

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-gmj6-6f8f-6699PyPIjinja2>=3.0.0 <3.1.53.1.5
PYSEC-2026-1472PyPIjinja2>=3.0.0 <3.1.53.1.5

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12jinja23.1.2-1+deb12u2DEBIAN-CVE-2024-56201
Debian13, 14jinja23.1.5-1DEBIAN-CVE-2024-56201
Ubuntu20.04:LTSjinja22.10.1-2ubuntu0.4UBUNTU-CVE-2024-56201 USN-7244-1 USN-7343-1
Ubuntu22.04:LTSjinja23.0.3-1ubuntu0.3UBUNTU-CVE-2024-56201 USN-7244-1 USN-7343-1
Ubuntu24.04:LTSjinja23.1.2-1ubuntu1.2UBUNTU-CVE-2024-56201 USN-7244-1 USN-7343-1
UbuntuPro:14.04:LTSjinja22.7.2-2ubuntu0.1~esm6UBUNTU-CVE-2024-56201 USN-7343-1
UbuntuPro:16.04:LTSjinja22.8-1ubuntu0.1+esm5UBUNTU-CVE-2024-56201 USN-7343-1
UbuntuPro:18.04:LTSjinja22.10-1ubuntu0.18.04.1+esm3UBUNTU-CVE-2024-56201 USN-7244-1 USN-7343-1
Red Hatansible_automation_platform:2.4::el8automation-controller-venv-tower0:4.5.17-1.el8apRHSA-2025:0721
Red Hatansible_automation_platform:2.4::el8, ansible_automation_platform_developer:2.4::el8, ansible_automation_platform_inside:2.4::el8python39-jinja2, python3x-jinja20:3.1.5-1.el8apRHSA-2025:0721
Red Hatansible_automation_platform:2.4::el9automation-controller-venv-tower0:4.5.17-1.el9apRHSA-2025:0721
Red Hatansible_automation_platform:2.4::el9, ansible_automation_platform_developer:2.4::el9, ansible_automation_platform_inside:2.4::el9python-jinja2, python3-jinja20:3.1.5-1.el9apRHSA-2025:0721
Red Hatansible_automation_platform:2.5::el8automation-controller-venv-tower0:4.6.7-1.el8apRHSA-2025:0777
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8python3.11-django0:4.2.18-1.el8apRHSA-2025:0777
Red Hatansible_automation_platform:2.5::el8, ansible_automation_platform_developer:2.5::el8, ansible_automation_platform_inside:2.5::el8python3.11-jinja20:3.1.5-1.el8apRHSA-2025:0777
Red Hatansible_automation_platform:2.5::el9automation-controller-venv-tower0:4.6.7-1.el9apRHSA-2025:0777
Red Hatansible_automation_platform:2.5::el9, ansible_automation_platform_developer:2.5::el9python3.11-django0:4.2.18-1.el9apRHSA-2025:0777
Red Hatansible_automation_platform:2.5::el9, ansible_automation_platform_developer:2.5::el9, ansible_automation_platform_inside:2.5::el9python3.11-jinja20:3.1.5-1.el9apRHSA-2025:0777
Red Hatenterprise_linux:9::appstreamfence-virt, fence-virtd, fence-agents and 23 more0:4.10.0-76.el9_5.4RHSA-2025:0308
Red Hatenterprise_linux:9::highavailability, enterprise_linux:9::resilientstoragefence-agents-all, fence-agents-apc, fence-agents-aws and 51 more0:4.10.0-76.el9_5.4RHSA-2025:0308
192 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise High Performance Computing 15 SP5-ESPOS and 7 morepython-Jinja23.1.2-150400.12.11.1SUSE-SU-2025:0006-1
SUSELinux Micro 6.0python-Jinja23.1.2-7.1SUSE-SU-2025:20117-1
SUSELinux Micro 6.1python-Jinja23.1.4-slfo.1.1_2.1SUSE-SU-2025:20254-1
openSUSELeap 15.5, Leap 15.6python-Jinja23.1.2-150400.12.11.1SUSE-SU-2025:0006-1
openSUSETumbleweedoci-cli3.54.1-1.1openSUSE-SU-2025:14997-1
AlmaLinux9fence-virt, fence-virtd, fence-virtd-cpg and 10 more4.10.0-76.el9_5.4.alma.1ALSA-2025:0308
Alpinev3.18, v3.19, v3.20 and 4 morepy3-jinja23.1.5-r0ALPINE-CVE-2024-56201
Azure Linux2python-jinja23.0.3-5AZL-54650
Azure Linux3python-jinja23.1.2-2AZL-54660
Alpaquita23py3-jinja23.1.6-r0BELL-CVE-2024-56201
Alpaquitastreampy3-jinja23.1.5-r0BELL-CVE-2024-56201

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability has rated as a IMPORTANT flaw because an attacker controlling both the template content and filename to execute arbitrary Python code, bypassing the sandbox.

Red Hat's mitigation

To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.

ProductPackageStateAdvisory
Ansible Automation Platform Execution Environmentsansible-automation-platform/ee-minimal-rhel8:2.12.10-57Fixed 2025-01-28RHSA-2025:0753
Ansible Automation Platform Execution Environmentsansible-automation-platform/ee-minimal-rhel9:2.18.1-4Fixed 2025-01-28RHSA-2025:0753
Ansible Automation Platform Execution Environmentsansible-automation-platform/ee-minimal-rhel8:2.12.10-59Fixed 2025-02-05RHSA-2025:1101
Ansible Automation Platform Execution Environmentsansible-automation-platform/ee-minimal-rhel9:2.15.13-10Fixed 2025-02-05RHSA-2025:1101
Discovery 1 for RHEL 9discovery/discovery-server-rhel9:1.12.0-1Fixed 2025-02-10RHSA-2025:1249
Discovery 1 for RHEL 9discovery/discovery-ui-rhel9:1.12.0-1Fixed 2025-02-10RHSA-2025:1249
Ironic content for Red Hat OpenShift Container Platform 4.12python-jinja2-0:3.0.1-6.el9.2Fixed 2025-02-06RHSA-2025:0834
Ironic content for Red Hat OpenShift Container Platform 4.13python-jinja2-0:3.0.1-6.el9.2Fixed 2025-02-13RHSA-2025:1118
Red Hat Ansible Automation Platform 2.4 for RHEL 8automation-controller-0:4.5.17-1.el8apFixed 2025-01-27RHSA-2025:0721
Red Hat Ansible Automation Platform 2.4 for RHEL 8python3x-jinja2-0:3.1.5-1.el8apFixed 2025-01-27RHSA-2025:0721
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-service-api-rhel9Affected
Red Hat Ansible Automation Platform 1.2ansible-towerWill not fix
Red Hat Ansible Automation Platform 2aap-cloud-metrics-collector-containerNot affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-24/ee-dellemc-openmanage-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ansible-dev-tools-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/de-supported-rhel8Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/platform-resource-runner-rhel8Not affected
Red Hat Developer Hub 1rhdh/rhdh-rhel9-operatorNot affected
Red Hat Enterprise Linux 10flatpak-sdk-containerNot affected
Red Hat Enterprise Linux 10python-jinja2Not affected
325 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-56201.

Attack patterns (CAPEC)

  • CAPEC-41 Using Meta-characters in E-mail Headers to Inject Malicious Payloads Likelihood: High · Severity: High
  • CAPEC-81 Web Server Logs Tampering Likelihood: Medium · Severity: High
  • CAPEC-93 Log Injection-Tampering-Forging Likelihood: High · Severity: High
  • CAPEC-134 Email Injection Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON