CVE-2024-56201
Public on
Last Modified:
Description
A flaw was found in the Jinja2 package. 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 Jinja's sandbox being used. An attacker needs to be able 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 that execute untrusted templates where the template author can also choose the template filename.
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.
Mitigation
To mitigate this vulnerabilty restrict user-controlled template filenames, ensuring they follow a predefined templates.
Additional Information
- This content is not included.Bugzilla 2333854: jinja2: Jinja has a sandbox breakout through malicious filenames
- Content from cwe.mitre.org is not included.CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences
- FAQ: Frequently asked questions about CVE-2024-56201
- Offline Security Data data is available for integration with other systems. See Offline Security Data API to get started.
External References
Content from www.cve.org is not included.https://www.cve.org/CVERecord?id=CVE-2024-56201
Content from nvd.nist.gov is not included.https://nvd.nist.gov/vuln/detail/CVE-2024-56201
Content from github.com is not included.https://github.com/pallets/jinja/issues/1792
Content from github.com is not included.https://github.com/pallets/jinja/releases/tag/3.1.5
Affected Packages and Issued Red Hat Security Errata
| Products / Services | Components | State | Errata |
|---|---|---|---|
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel8 | Fixed | RHSA-2025:0753 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel9 | Fixed | RHSA-2025:0753 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel8 | Fixed | RHSA-2025:1101 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel9 | Fixed | RHSA-2025:1101 |
| Discovery 1 for RHEL 9 | discovery/discovery-server-rhel9 | Fixed | RHSA-2025:1249 |
| Discovery 1 for RHEL 9 | discovery/discovery-ui-rhel9 | Fixed | RHSA-2025:1249 |
| Ironic content for Red Hat OpenShift Container Platform 4.12 | python-jinja2 | Fixed | RHSA-2025:0834 |
| Ironic content for Red Hat OpenShift Container Platform 4.13 | python-jinja2 | Fixed | RHSA-2025:1118 |
| OpenShift Lightspeed | openshift-lightspeed-tech-preview/lightspeed-service-api-rhel9 | Affected | |
| Red Hat Ansible Automation Platform 1.2 | ansible-tower | Will not fix | |
| Red Hat Ansible Automation Platform 2 | aap-cloud-metrics-collector-container | Not affected | |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/de-supported-rhel8 | Not affected | |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-24/ee-dellemc-openmanage-rhel8 | Not affected | |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/ansible-dev-tools-rhel8 | Not affected | |
| Red Hat Ansible Automation Platform 2 | ansible-automation-platform-25/platform-resource-runner-rhel8 | Not affected | |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | automation-controller | Fixed | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | python3x-jinja2 | Fixed | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | ansible-automation-platform-24/lightspeed-rhel8-operator | Fixed | RHSA-2025:0722 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 9 | automation-controller | Fixed | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 9 | python-jinja2 | Fixed | RHSA-2025:0721 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | ansible-automation-platform-25/lightspeed-rhel8 | Fixed | RHSA-2025:0341 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | automation-controller | Fixed | RHSA-2025:0777 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | python3.11-jinja2 | Fixed | RHSA-2025:0777 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | automation-controller | Fixed | RHSA-2025:0777 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | python3.11-jinja2 | Fixed | RHSA-2025:0777 |
| Red Hat Developer Hub | rhdh/rhdh-rhel9-operator | Not affected | |
| Red Hat Developer Hub (RHDH) 1.4 | rhdh/rhdh-hub-rhel9 | Fixed | RHBA-2025:0409 |
| Red Hat Developer Hub 1.3 on RHEL 9 | rhdh-hub-container | Fixed | RHBA-2025:0610 |
| Red Hat Developer Hub 1.5 | rhdh/rhdh-hub-rhel9 | Fixed | RHSA-2025:3374 |
| Red Hat Enterprise Linux 10 | flatpak-sdk-container | Not affected | |
| Red Hat Enterprise Linux 10 | python-jinja2 | Not affected | |
| Red Hat Enterprise Linux 6 | python-jinja2 | Out of support scope | |
| Red Hat Enterprise Linux 7 | python-jinja2 | Not affected | |
| Red Hat Enterprise Linux 8 | python-jinja2 | Not affected | |
| Red Hat Enterprise Linux 9 | fence-agents | Fixed | 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.0 Update Services for SAP Solutions | fence-agents | Fixed | RHSA-2025:0345 |
| Red Hat Enterprise Linux 9.2 Extended Update Support | fence-agents | Fixed | RHSA-2025:0335 |
| Red Hat Enterprise Linux 9.4 Extended Update Support | fence-agents | Fixed | RHSA-2025:0338 |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-amd-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-aws-nvidia-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-amd-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-nvidia-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-gcp-nvidia-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-ibm-nvidia-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-intel-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-amd-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-intel-rhel9 | Will not fix | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-nvidia-rhel9 | Will not fix | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-api-server-v2-rhel8 | Not affected | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-driver-rhel8 | Not affected | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-launcher-rhel8 | Not affected | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-persistenceagent-v2-rhel8 | Not affected | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-scheduledworkflow-v2-rhel8 | Not affected | |
| Red Hat OpenShift AI 2.16 | rhoai/odh-model-registry-rhel8 | Fixed | RHSA-2025:3368 |
| Red Hat OpenShift AI 2.16 | rhoai/odh-model-registry-rhel8 | Fixed | RHSA-2025:3397 |
| Red Hat OpenShift Container Platform 4 | openshift4/ose-ovn-kubernetes-microshift-rhel9 | Affected | |
| Red Hat OpenShift Container Platform 4 | openshift4/ztp-site-generate-rhel8 | Affected | |
| Red Hat OpenShift Container Platform 4 | openshift4/cnf-tests-rhel8 | Not affected | |
| Red Hat OpenShift Container Platform 4 | openshift4/ose-ovn-kubernetes | Will not fix | |
| Red Hat OpenShift Container Platform 4.14 | python-jinja2 | Fixed | RHSA-2025:0842 |
| Red Hat OpenShift Container Platform 4.15 | python-jinja2 | Fixed | RHSA-2025:1130 |
| Red Hat OpenShift Container Platform 4.16 | python-jinja2 | Fixed | RHSA-2025:0830 |
| Red Hat OpenShift Container Platform 4.16 | openshift4/ose-ansible-rhel9-operator | Fixed | RHSA-2025:1123 |
| Red Hat OpenShift Container Platform 4.17 | python-jinja2 | Fixed | RHSA-2025:0656 |
| Red Hat OpenShift Container Platform 4.17 | openshift4/ose-ansible-rhel9-operator | Fixed | RHSA-2025:0875 |
| Red Hat OpenShift distributed tracing 3 | rhosdt/opentelemetry-collector-rhel8 | Affected | |
| Red Hat OpenShift distributed tracing 3 | rhosdt/opentelemetry-operator-bundle | Affected | |
| Red Hat OpenShift distributed tracing 3 | rhosdt/opentelemetry-rhel8-operator | Affected | |
| Red Hat OpenShift distributed tracing 3 | rhosdt/opentelemetry-target-allocator-rhel8 | Will not fix | |
| Red Hat OpenStack Platform 17.1 for RHEL 9 | openstack-ansible-core | Fixed | RHSA-2025:1861 |
| Red Hat OpenStack Platform 18.0 | python-jinja2 | Affected | |
| Red Hat Quay 3 | quay/quay-rhel8 | Affected | |
| Red Hat Satellite 6.15 for RHEL 8 | python-jinja2 | Fixed | RHSA-2025:3491 |
| Red Hat Update Infrastructure 4 for Cloud Providers | python-jinja2 | Not affected |
Common Vulnerability Scoring System (CVSS) Score Details
Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authorities (CNA) source for its products and services (see Red Hat classifications ).
| CVSS v3 Score Breakdown | Red Hat | NVD |
|---|---|---|
| CVSS v3 Base Score | 7.3 | 8.8 |
| Attack Vector | Local | Local |
| Attack Complexity | Low | Low |
| Privileges Required | Low | Low |
| User Interaction | Required | None |
| Scope | Unchanged | Changed |
| Confidentiality Impact | High | High |
| Integrity Impact | High | High |
| Availability Impact | High | High |
CVSS v3 Vector
Red Hat CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
NVD CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Frequently Asked Questions
Why is Red Hat's CVSS v3 score or Impact different from other vendors?
For more information, see https://access.redhat.com/solutions/762393.
My product is listed as "Under investigation" or "Affected", when will Red Hat release a fix for this vulnerability?
- "Under investigation" doesn't necessarily mean that the product is affected by this vulnerability. It only means that our Analysis Team is still working on determining whether the product is affected and how it is affected.
- "Affected" means that our Analysis Team has determined that this product is affected by this vulnerability and might release a fix to address this in the near future.
What can I do if my product is listed as "Will not fix"?
Available options depend mostly on the Impact of the vulnerability and the current Life Cycle phase of your product. Overall, you have the following options:
- Upgrade to a supported product version that includes a fix for this vulnerability (recommended).
- Apply a mitigation (if one exists).
- Open a This content is not included.support case to request a prioritization of releasing a fix for this vulnerability.
What can I do if my product is listed as "Fix deferred"?
Available options depend mostly on the Impact of the vulnerability and the current Life Cycle phase of your product. Overall, you have the following options:
- Apply a mitigation (if one exists).
- Open a This content is not included.support case to request a prioritization of releasing a fix for this vulnerability.
- Red Hat Engineering focuses on addressing high-priority issues based on their complexity or limited lifecycle support. Therefore, lower-priority issues will not receive immediate fixes.
What is a mitigation?
I have a Red Hat product but it is not in the above list, is it affected?
Why is my security scanner reporting my product as vulnerable to this vulnerability even though my product version is fixed or not affected?
My product is listed as "Out of Support Scope". What does this mean?
Not sure what something means? Check out our Security Glossary.