CVE-2025-27516: Jinja sandbox breakout through attr filter selecting format method
Vulnerability summary
CVE-2025-27516 is a high (CVSS 8.8) vulnerability in debian debian_linux. EPSS estimates a 0.51% chance of exploitation in the next 30 days, higher than 43.3% of scored vulnerabilities.
Not severe (CVSS 5.4, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 4 · Related 19Timeline
- 05-03-2025PublishedVulnerability first disclosed.
- 26-02-2026Last modifiedVulnerability information updated.
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.
CVSS metrics
11 scores · 9 sources · 2 versions- OSV · PypiEcosystem advisory · calculated5.4MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · UbuntuEcosystem advisory · calculated5.4MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · WolfiEcosystem advisory · calculated5.4MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- OSV · ChainguardEcosystem advisory · calculated5.4MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- NVDNIST5.4MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- OSV · AlpineEcosystem advisory · calculated8.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- OSV · Red hatEcosystem advisory · calculated7.3HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:HDiffers
- OSV · UbuntuEcosystem advisory · calculated8.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated8.8HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
EPSS trend
Probability
0.51%
Chance of exploitation in the next 30 days
Percentile
43%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.51% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, low-privilege account, user interaction (CVSS vector). Other conditions: not stated in public data.
Redhat77 products
- automation-controller-venv-tower< 0:4.5.20-1.el8ap | < 0:4.5.20-1.el9ap
- fence-agents< 0:4.10.0-62.el9_4.11 | < 0:4.10.0-20.el9_0.21 | < 0:4.10.0-43.el9_2.12 | < 0:4.10.0-76.el9_5.6
- fence-agents-aliyun< 0:4.10.0-62.el9_4.11 | < 0:4.10.0-20.el9_0.21 | < 0:4.10.0-43.el9_2.12 | < 0:4.10.0-76.el9_5.6
- fence-agents-all< 0:4.10.0-62.el9_4.11 | < 0:4.10.0-20.el9_0.21 | < 0:4.10.0-43.el9_2.12 | < 0:4.10.0-76.el9_5.6
- fence-agents-amt-ws< 0:4.10.0-62.el9_4.11 | < 0:4.10.0-20.el9_0.21 | < 0:4.10.0-43.el9_2.12 | < 0:4.10.0-76.el9_5.6
Suse21 products
- python-Jinja2&distro=SUSE Enterprise Storage 7.1< 2.10.1-150000.3.21.1
- python-Jinja2&distro=SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS< 2.10.1-150000.3.21.1
- python-Jinja2&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS< 2.10.1-150000.3.21.1
- python-Jinja2&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS< 2.10.1-150000.3.21.1
- python-Jinja2&distro=SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS< 2.10.1-150000.3.21.1
Chainguard11 products
- checkov< 3.2.432-r0
- jupyter-base-notebook< 7.3.2-r2
- jupyter-docker-base< 999.9.9_git20260925-r0
- jupyter-docker-stacks< 999.9.9_git20260925-r0 | < 7.3.2-r1
- nemo< 1.23.0-r11
Wolfi5 products
- checkov< 3.2.432-r0
- jupyter-base-notebook< 7.3.2-r2
- jupyter-docker-base< 999.9.9_git20260925-r0
- jupyter-docker-stacks< 999.9.9_git20260925-r0 | < 7.3.2-r1
- reflex< 0.7.2-r0
Debian2 products
- jinja2< 3.1.2-1+deb12u3 | < 3.1.6-1
- debian_linuxEOL11.0
Alpine1 product
- py3-jinja2< 3.1.6-r0
Mageia1 product
- python-jinja2< 3.1.6-1.mga9
Opensuse1 product
- python-Jinja2&distro=openSUSE Leap 15.6< 3.1.2-150400.12.14.1
Pallets1 product
- jinja< 3.1.6
Palletsprojects1 product
- jinja< 3.1.6
PyPI1 product
- jinja2< 3.1.6
Ubuntu1 product
- jinja2< 2.7.2-2ubuntu0.1~esm6 | < 2.8-1ubuntu0.1+esm5 | < 2.10-1ubuntu0.18.04.1+esm4 | < 2.10.1-2ubuntu0.5 | < 3.0.3-1ubuntu0.4 | < 3.1.2-1ubuntu1.3
12 vendors · 123 products
References
62 links- github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7X Refsource CONFIRMWEBARTICLEREPORTAdvisoryVendor Advisory
- github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403X Refsource MISCWEBFIXARTICLEREPORTPatch
Show all 62 references
- github.com/pallets/jinjaPACKAGE
- pypi.org/project/jinja2PACKAGE
- images.redhat.comARTICLE