CVE-2025-27516 Details
Description
Jinja is an extensible templating engine. Prior to 3.1.6, an oversight in how the Jinja sandboxed environment interacts with the |attr filter 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 which 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. After the fix, the |attr filter no longer bypasses the environment's attribute lookup. This vulnerability is fixed in 3.1.6.
A vulnerability in Jinja prior to version 3.1.6 allows for arbitrary code execution by bypassing the sandboxed environment. This issue arises from an oversight in how the sandbox interacts with the |attr filter, enabling an attacker to exploit untrusted templates. While Jinja's sandbox typically prevents calls to str.format from escaping, the |attr filter can be manipulated to access a string's format method, circumventing the sandbox's protections. Applications that execute untrusted templates are particularly vulnerable.
Users should upgrade to Jinja version 3.1.6 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 31, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html | CVE | |
| https://lists.debian.org/debian-lts-announce/2025/04/msg00045.html | CVE | Mailing ListThird Party Advisory |
| https://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403 | [email protected] | Patch |
| https://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7 | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1336 | Improper Neutralization of Special Elements Used in a Template Engine | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| palletsprojects jinja | < 3.1.6 |
CPE
Remediation
| |
| debian debian linux | 11.0 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 3, 2025 | CVE Modified | CVE |
| Sep 22, 2025 | Initial Analysis | [email protected] |
| May 1, 2025 | CVE Modified | CVE |
| Mar 5, 2025 | New CVE Received | [email protected] |