CVE-2025-27516Medium· 7.3▾ SunlitJinja2 vulnerable to sandbox breakout through attr filter selecting format method
▾ Sunlit zone — Low / medium · no exploitation signal
impact 40.2 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 8.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
0.5%
0.5% → 0.5%
Last analysed / modified upstream
medium → high
high → medium
medium → high
high → medium
medium → high
high → medium
medium → high
high → medium
medium → high
high → medium
medium → high
high → medium
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.
jinja2 < 3.1.6Upgrade to a patched release:
jinja2 3.1.6Field changes observed since this record was first indexed.
Connected by shared product, vendor, weakness, or advisory.
CVE-2024-56326High· 7.8Jinja has a sandbox breakout through indirect reference to format method
CVE-2024-22195Medium· 5.4Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
CVE-2024-56201High· 8.8Jinja has a sandbox breakout through malicious filenames
CVE-2024-34064Medium· 5.4Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter
CVE-2026-46636High· 8.7Twig is a template language for PHP
CVE-2026-37004Critical· 9.8LiteLLM vulnerable to server-side template injection in the /prompts/test endpoint