{"cve":"CVE-2025-27516","nvd":{"published":"2025-03-05T21:15:20.073","modified":"2026-06-17T09:03:44.560","status":"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.","cvss_v4":{"vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":5.4},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.8},"cwes":["CWE-1336"],"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"],"products":["debian:debian_linux","palletsprojects:jinja"],"source":"nvd","synced_at":"2026-10-19T22:00:17.429720821+00:00"},"epss":{"cve":"CVE-2025-27516","score":0.00507,"percentile":0.43277,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-cpwx-vrp4-4pq7","url":"https://osv.dev/vulnerability/GHSA-cpwx-vrp4-4pq7","summary":"Jinja2 vulnerable to sandbox breakout through attr filter selecting format method","modified":"2026-09-10T03:49:48.526758681Z","packages":[{"ecosystem":"PyPI","name":"jinja2","purl":"pkg:pypi/jinja2","ranges":["<3.1.6"],"fixed":["3.1.6"]}]},{"id":"PYSEC-2026-1471","url":"https://osv.dev/vulnerability/PYSEC-2026-1471","summary":"Jinja2 vulnerable to sandbox breakout through attr filter selecting format method","modified":"2026-07-07T17:46:43.358335981Z","packages":[{"ecosystem":"PyPI","name":"jinja2","purl":"pkg:pypi/jinja2","ranges":["<3.1.6"],"fixed":["3.1.6"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}