CVE-2025-27516
Public on
Last Modified:
Description
A flaw was found in Jinja. In affected versions, an oversight in how the Jinja sandboxed environment interacts with the |attr filter allows an attacker who 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, it's possible to use the |attr filter to get a reference to a string's plain format method, bypassing the sandbox.
Statement
This vulnerability is rated as important severity due to the potential for an attacker to bypass Jinja's sandbox by exploiting the |attr filter, by controlling template content, an attacker can execute arbitrary Python code, impacting the integrity, confidentiality, and availability of the system. While the attack requires user interaction to trigger untrusted templates, the risk is significant in applications that allow such templates to be executed.
Additional Information
- This content is not included.Bugzilla 2350190: jinja2: Jinja sandbox breakout through attr filter selecting format method
- Content from cwe.mitre.org is not included.CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
- FAQ: Frequently asked questions about CVE-2025-27516
- 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-2025-27516
Content from nvd.nist.gov is not included.https://nvd.nist.gov/vuln/detail/CVE-2025-27516
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:2664 |
| Ansible Automation Platform Execution Environments | ansible-automation-platform/ee-minimal-rhel9 | Fixed | RHSA-2025:2664 |
| OpenShift Serverless | openshift-serverless-1/kn-eventing-istio-controller-rhel8 | Will not fix | |
| 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/platform-resource-runner-rhel8 | Not affected | |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | automation-controller | Fixed | RHSA-2025:3123 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | python3x-jinja2 | Fixed | RHSA-2025:3123 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 8 | ansible-automation-platform-24/lightspeed-rhel8 | Fixed | RHSA-2025:3124 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 9 | automation-controller | Fixed | RHSA-2025:3123 |
| Red Hat Ansible Automation Platform 2.4 for RHEL 9 | python-jinja2 | Fixed | RHSA-2025:3123 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | automation-controller | Fixed | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | python3.11-jinja2 | Fixed | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | ansible-automation-platform-25/lightspeed-rhel8 | Fixed | RHSA-2025:3162 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | automation-controller | Fixed | RHSA-2025:3160 |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | python3.11-jinja2 | Fixed | RHSA-2025:3160 |
| Red Hat Ceph Storage 7 | ceph | Not affected | |
| Red Hat Ceph Storage 8 | ceph | Not affected | |
| Red Hat Ceph Storage 9 | ceph | Not affected | |
| Red Hat Developer Hub (RHDH) 1.4 | rhdh/rhdh-hub-rhel9 | Fixed | RHSA-2025:3595 |
| Red Hat Developer Hub 1.5 | rhdh/rhdh-hub-rhel9 | Fixed | RHSA-2025:3374 |
| Red Hat Discovery 1 | discovery-server-container | Not affected | |
| Red Hat Enterprise Linux 10 | python-jinja2 | Fixed | RHSA-2025:7476 |
| Red Hat Enterprise Linux 8 | python-jinja2 | Fixed | RHSA-2025:3388 |
| Red Hat Enterprise Linux 8.2 Advanced Update Support | python-jinja2 | Fixed | RHSA-2025:3671 |
| Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support | python-jinja2 | Fixed | RHSA-2025:3562 |
| Red Hat Enterprise Linux 8.4 Telecommunications Update Service | python-jinja2 | Fixed | RHSA-2025:3562 |
| Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions | python-jinja2 | Fixed | RHSA-2025:3562 |
| Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support | python-jinja2 | Fixed | RHSA-2025:3622 |
| Red Hat Enterprise Linux 8.6 Telecommunications Update Service | python-jinja2 | Fixed | RHSA-2025:3622 |
| Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions | python-jinja2 | Fixed | RHSA-2025:3622 |
| Red Hat Enterprise Linux 8.8 Extended Update Support | python-jinja2 | Fixed | RHSA-2025:3580 |
| Red Hat Enterprise Linux 9 | fence-agents | Fixed | RHSA-2025:3113 |
| Red Hat Enterprise Linux 9 | python-jinja2 | Fixed | RHSA-2025:3406 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | fence-agents | Fixed | RHSA-2025:3017 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | python-jinja2 | Fixed | RHSA-2025:3588 |
| Red Hat Enterprise Linux 9.2 Extended Update Support | fence-agents | Fixed | RHSA-2025:3111 |
| Red Hat Enterprise Linux 9.2 Extended Update Support | python-jinja2 | Fixed | RHSA-2025:3585 |
| Red Hat Enterprise Linux 9.4 Extended Update Support | fence-agents | Fixed | RHSA-2025:2688 |
| Red Hat Enterprise Linux 9.4 Extended Update Support | python-jinja2 | Fixed | RHSA-2025:3586 |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-amd-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-aws-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-amd-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-azure-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-gcp-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-ibm-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-intel-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/bootc-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/docling-serve-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-amd-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-intel-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/instructlab-nvidia-rhel9 | Affected | |
| Red Hat Enterprise Linux AI (RHEL AI) | rhelai1/ui-rhel9 | Affected | |
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-model-registry-rhel8 | Affected | |
| 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 Container Platform 4 | openshift4/cnf-tests-rhel8 | Affected | |
| Red Hat OpenShift Container Platform 4 | openshift4/ztp-site-generate-rhel8 | Affected | |
| Red Hat OpenShift Container Platform 4 | openshift4/ose-ovn-kubernetes-microshift-rhel9 | Not affected | |
| Red Hat OpenShift Container Platform 4 | openshift4/ose-ovn-kubernetes | Will not fix | |
| Red Hat OpenShift Container Platform 4 | ose-ovn-kubernetes-base-container | Will not fix | |
| Red Hat OpenShift Container Platform 4.12 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:4408 |
| Red Hat OpenShift Container Platform 4.13 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:3779 |
| Red Hat OpenShift Container Platform 4.14 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:3568 |
| Red Hat OpenShift Container Platform 4.15 | openshift4/ose-ansible-operator | Fixed | RHSA-2025:3789 |
| Red Hat OpenShift Container Platform 4.16 | openshift4/ose-ansible-rhel9-operator | Fixed | RHSA-2025:4730 |
| Red Hat OpenShift Container Platform 4.17 | openshift4/ose-ansible-rhel9-operator | Fixed | RHSA-2025:4203 |
| Red Hat OpenShift Container Platform 4.17 | openshift4/ose-olm-operator-controller-rhel9 | Fixed | RHSA-2025:4431 |
| Red Hat OpenShift Container Platform 4.18 | openshift4/ose-olm-operator-controller-rhel9 | Fixed | RHSA-2025:3775 |
| Red Hat OpenShift Container Platform 4.18 | openshift4/ose-ansible-rhel9-operator | Fixed | RHSA-2025:4018 |
| Red Hat OpenStack Platform 17.1 for RHEL 9 | openstack-ansible-core | Fixed | RHSA-2025:3371 |
| Red Hat Quay 3 | quay/quay-rhel8 | 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.