Vulnerability in Pallets Jinja
CVE-2025-27516
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.
Published · last modified .
CVSS v3 metric
CVSS v3 base score 8.8 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
EPSS exploit prediction
EPSS: 0.005 (40.9th percentile), scored .
Very low probability of exploitation in the next 30 days; routine patching cadence is appropriate. 41st percentile — 40.9% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.
EPSS over last 30 days · oldest: 0.005 · newest: 0.005 · change: +0.000
Affected products
- Pallets Jinja — versions < 3.1.6
- Palletsprojects Jinja
- Debian Linux — versions 11.0
Weakness classification (CWE)
Public proof-of-concept exploits
References
- github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7 (Vendor Advisory)
- github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403 (Patch)
- af854a3a-2127-422b-91ae-364da2661108
- af854a3a-2127-422b-91ae-364da2661108 (Mailing List, Third Party Advisory)
Frequently asked questions
- What is CVE-2025-27516?
- CVE-2025-27516 is a high-severity vulnerability in Pallets Jinja, classified under Improper Neutralization of Special Elements Used in a Template Engine. CVSS score: 8.8/10. Published 2025-03-05.
- How severe is CVE-2025-27516?
- High severity. CVSS v3 base score is 8.8 out of 10.
- Is CVE-2025-27516 known to be exploited?
- 3 public proof-of-concept repositories are indexed. Not currently listed in the CISA KEV catalog.