CVE-2025-27516
CVE-2025-27516 is a high-severity vulnerability in Palletsprojects Jinja with a CVSS 3.x base score of 8.8. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-1336.
Key facts
- Severity: High (CVSS 3.x base score 8.8)
- CVSS v4: 5.4
- EPSS exploit prediction: 0% (37th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2025-6152
- Weakness: CWE-1336
- Affected product: Palletsprojects Jinja
- Published:
- Last modified:
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.
Frequently asked questions
- What is 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.
- How severe is CVE-2025-27516?
- CVE-2025-27516 has a CVSS 3.x base score of 8.8, rated high severity. It is exploitable over local access with low attack complexity, requires low privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2025-27516 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 0% (37th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2025-27516?
- CVE-2025-27516 primarily affects Palletsprojects Jinja. In total, 2 product configurations (CPEs) are listed as vulnerable; see the affected-products list for the exact versions.
- How do I fix CVE-2025-27516?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- Does CVE-2025-27516 have an EU (EUVD) identifier?
- Yes. CVE-2025-27516 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2025-6152.
- When was CVE-2025-27516 published?
- CVE-2025-27516 was published on 2025-03-05 and last updated on 2026-06-17.
References
- https://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403
- https://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7
- https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html
- https://lists.debian.org/debian-lts-announce/2025/04/msg00045.html
Affected products (2)
- cpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:*
- cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
More vulnerabilities in Palletsprojects Jinja
- CVE-2024-56201 — High (CVSS 8.8): Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, a bug in the Jinja compiler…
- CVE-2016-10745 — High (CVSS 8.6): In Pallets Jinja before 2.8.1, str.format allows a sandbox escape.
- CVE-2019-10906 — High (CVSS 8.6): In Pallets Jinja before 2.10.1, str.format_map allows a sandbox escape.
- CVE-2024-56326 — High (CVSS 7.8): Jinja is an extensible templating engine. Prior to 3.1.5, An oversight in how the Jinja sandboxed environment detects…
- CVE-2024-34064 — Medium (CVSS 5.4): Jinja is an extensible templating engine. The `xmlattr` filter in affected versions of Jinja accepts keys containing…
- CVE-2024-22195 — Medium (CVSS 5.4): Jinja is an extensible templating engine. Special placeholders in the template allow writing code similar to Python…
All CVEs affecting Palletsprojects Jinja →
Other CWE-1336 vulnerabilities
- CVE-2025-53833 — Critical (CVSS 10.0): LaRecipe is an application that allows users to create documentation with Markdown inside a Laravel app. Versions prior…
- CVE-2024-32651 — Critical (CVSS 10.0): changedetection.io is an open source web page change detection, website watcher, restock monitor and notification…
- CVE-2026-45312 — Critical (CVSS 9.9): RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine. In 0.24.0 and earlier, a Jinja2 template…
- CVE-2026-9558 — Critical (CVSS 9.9): A Server-Side Template Injection (SSTI) vulnerability exists in Mautic's theme engine. The platform renders uploaded…
- CVE-2026-33897 — Critical (CVSS 9.9): Incus is a system container and virtual machine manager. Prior to version 6.23.0, instance template files can be used…
- CVE-2026-1868 — Critical (CVSS 9.9): GitLab has remediated a vulnerability in the Duo Workflow Service component of GitLab AI Gateway affecting all versions…