{"vuln_id":"CVE-2025-27516","aliases":["GHSA-cpwx-vrp4-4pq7"],"description":"Jinja2 vulnerable to sandbox breakout through attr filter selecting format method","published_at":"2025-03-05T20:40:14Z","modified_at":"2026-11-18T00:45:13.756181Z","first_seen_at":"2026-11-21T19:15:20.163077Z","severity":"medium","severity_source":"ghsa","cvss_score":5.4,"cvss_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","cwe":["CWE-1336"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00507,"epss_percentile":0.4385,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-27516"},"matched_alias":null,"items":[{"id":10784,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-cpwx-vrp4-4pq7: Jinja2 vulnerable to sandbox breakout through attr filter selecting format method","summary":"Jinja2 vulnerable to sandbox breakout through attr filter selecting format method\n\nAn 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.\n\nTo 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.\n\nJinja'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.\n\nAffected: PyPI:jinja2\n\nFixed in: 3.1.6\n\nReferences:\nhttps://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7\nhttps://nvd.nist.gov/vuln/detail/CVE-2025-27516\nhttps://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403\nhttps://github.com/pallets/jinja\nhttps://github.com/pallets/jinja/releases/tag/3.1.6\nhttps://github.com/pypa/advisory-database/tree/main/vulns/jinja2/PYSEC-2026-1471.yaml\nhttps://lists.debian.org/debian-lts-announce/2025/04/msg00022.html\nhttps://lists.debian.org/debian-lts-announce/2025/04/msg00045.html","url":"https://osv.dev/vulnerability/GHSA-cpwx-vrp4-4pq7","published_at":"2025-03-05T20:40:14Z","updated_at":"2026-11-18T00:45:13.756181Z","fetched_at":"2026-11-21T19:15:55.946173Z","severity":"medium","cvss_score":5.4,"epss":0.00507,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"jinja2","vuln_id":"CVE-2025-27516","vuln_ids":["CVE-2025-27516","GHSA-CPWX-VRP4-4PQ7","PYSEC-2026-1471"],"tags":["osv","pypi","fix-available"],"cluster_id":2331,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10784","html":"https://vulnwatch.ve1ve2.com/item/10784"}},{"id":2447,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-cpwx-vrp4-4pq7 / CVE-2025-27516: Jinja2 vulnerable to sandbox breakout through attr filter selecting format method","summary":"Jinja2 vulnerable to sandbox breakout through attr filter selecting format method\n\nAn 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.\n\nTo 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.\n\nJinja'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.\n\nAffected packages: pip:Jinja2\nPatched: Jinja2 3.1.6","url":"https://github.com/advisories/GHSA-cpwx-vrp4-4pq7","published_at":"2025-03-05T20:40:14Z","updated_at":"2026-11-18T00:13:09Z","fetched_at":"2026-11-21T19:15:18.416843Z","severity":"medium","cvss_score":5.4,"epss":0.00507,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"Jinja2","vuln_id":"CVE-2025-27516","vuln_ids":["CVE-2025-27516","GHSA-CPWX-VRP4-4PQ7"],"tags":["ghsa","pip","CWE-1336"],"cluster_id":2331,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2447","html":"https://vulnwatch.ve1ve2.com/item/2447"}}]}