CVE-2024-56326
Public on
Last Modified:
Description
A flaw was found in the Jinja package. In affected versions of Jinja, an oversight in how the Jinja sandboxed environment detects calls to str.format allows an attacker that controls the content of a template to execute arbitrary Python code. To exploit the vulnerability, an attacker needs to control the content 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. Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, storing a reference to a malicious string's format method is possible, then passing that to a filter that calls it. No such filters are built into Jinja but could be present through custom filters in an application. After the fix, such indirect calls are also handled by the sandbox.
Statement
This vulnerability is rated as Moderate due to an oversight in Jinja's sandbox environment, allowing attackers to execute arbitrary Python code through controlled template content. This requires control over template content, making exploitation possible only in specific applications, thus limiting its overall impact.
Additional Information
- This content is not included.Bugzilla 2333856: jinja2: Jinja has a sandbox breakout through indirect reference to format method
- Content from cwe.mitre.org is not included.CWE-94: Improper Control of Generation of Code ('Code Injection')
- FAQ: Frequently asked questions about CVE-2024-56326
- 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-56326
Content from nvd.nist.gov is not included.https://nvd.nist.gov/vuln/detail/CVE-2024-56326
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 | Not affected | |
| Red Hat Ansible Automation Platform 2 | aap-cloud-metrics-collector-container | Fix deferred | |
| 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 | Not affected | |
| Red Hat Enterprise Linux 10 | python-jinja2 | Not affected | |
| Red Hat Enterprise Linux 6 | python-jinja2 | Fix deferred | |
| Red Hat Enterprise Linux 7 Extended Lifecycle Support | python-jinja2 | Fixed | RHSA-2025:1250 |
| Red Hat Enterprise Linux 8 | python-jinja2 | Fixed | RHSA-2025:0711 |
| Red Hat Enterprise Linux 8.2 Advanced Update Support | python-jinja2 | Fixed | RHSA-2025:2612 |
| Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support | python-jinja2 | Fixed | RHSA-2025:1109 |
| Red Hat Enterprise Linux 8.4 Telecommunications Update Service | python-jinja2 | Fixed | RHSA-2025:1109 |
| Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions | python-jinja2 | Fixed | RHSA-2025:1109 |
| Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support | python-jinja2 | Fixed | RHSA-2025:0950 |
| Red Hat Enterprise Linux 8.6 Telecommunications Update Service | python-jinja2 | Fixed | RHSA-2025:0950 |
| Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions | python-jinja2 | Fixed | RHSA-2025:0950 |
| Red Hat Enterprise Linux 8.8 Extended Update Support | python-jinja2 | Fixed | RHSA-2025:0883 |
| Red Hat Enterprise Linux 9 | rhel9/keylime-registrar | Affected | |
| Red Hat Enterprise Linux 9 | fence-agents | Fixed | RHSA-2025:0308 |
| Red Hat Enterprise Linux 9 | python-jinja2 | Fixed | RHSA-2025:0667 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | fence-agents | Fixed | RHSA-2025:0345 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | python-jinja2 | Fixed | RHSA-2025:0951 |
| Red Hat Enterprise Linux 9.2 Extended Update Support | fence-agents | Fixed | RHSA-2025:0335 |
| Red Hat Enterprise Linux 9.2 Extended Update Support | python-jinja2 | Fixed | RHSA-2025:0978 |
| Red Hat Enterprise Linux 9.4 Extended Update Support | fence-agents | Fixed | RHSA-2025:0338 |
| Red Hat Enterprise Linux 9.4 Extended Update Support | python-jinja2 | Fixed | RHSA-2025:0850 |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-amd-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-aws-nvidia-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-amd-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-nvidia-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-gcp-nvidia-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-ibm-nvidia-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-intel-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-amd-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-intel-rhel9 | Fix deferred | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-nvidia-rhel9 | Fix deferred | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-model-registry-rhel8 | Affected | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-api-server-v2-rhel8 | Will not fix | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-driver-rhel8 | Will not fix | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-launcher-rhel8 | Will not fix | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-persistenceagent-v2-rhel8 | Will not fix | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-ml-pipelines-scheduledworkflow-v2-rhel8 | Will not fix | |
| Red Hat OpenShift Container Platform 4 | openshift4/ose-ovn-kubernetes-microshift-rhel9 | Fix deferred | |
| Red Hat OpenShift Container Platform 4 | openshift4/ztp-site-generate-rhel8 | Fix deferred | |
| 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.12 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:1241 |
| Red Hat OpenShift Container Platform 4.13 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:2700 |
| 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.15 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:1710 |
| 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 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 | satellite-capsule:el8/python-jinja2 | Affected | |
| Red Hat Satellite 6 | satellite:el8/python-jinja2 | Affected | |
| Red Hat Satellite 6.16 for RHEL 8 | python-jinja2 | Fixed | RHSA-2025:2399 |
| Red Hat Satellite 6.16 for RHEL 9 | python-jinja2 | Fixed | RHSA-2025:2399 |
| Red Hat Satellite 6.17 for RHEL 9 | python-jinja2 | Fixed | RHSA-2025:4576 |
| 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 | 6.3 | |
| Attack Vector | Local | |
| Attack Complexity | High | |
| Privileges Required | High | |
| User Interaction | Required | |
| Scope | Unchanged | |
| Confidentiality Impact | High | |
| Integrity Impact | High | |
| Availability Impact | High |
CVSS v3 Vector
Red Hat CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/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.