CVE-2025-27516

8.8 HIGH
Published: March 05, 2025 Modified: November 03, 2025

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.

AI Explanation

Get an AI-powered plain-language explanation of this vulnerability and remediation steps.

Login to generate AI explanation

CVSS v3.x Details

0.0 Low Medium High Critical 10.0
Vector String
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

References to Advisories, Solutions, and Tools

Patch Vendor Advisory Exploit Third Party Advisory
https://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7
Source: security-advisories@github.com
Vendor Advisory
https://lists.debian.org/debian-lts-announce/2025/04/msg00045.html
Source: af854a3a-2127-422b-91ae-364da2661108
Mailing List Third Party Advisory

4 reference(s) from NVD

Quick Stats

CVSS v3 Score
8.8 / 10.0
EPSS (Exploit Probability)
0.3%
50th percentile
Exploitation Status
Not in CISA KEV

Weaknesses (CWE)

Affected Vendors

debian palletsprojects