Jinja has a sandbox breakout through malicious filenames
A bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox is used.
To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | jinja2 | >= 3.0.0, < 3.1.5 | 3.1.5 |
References
- https://github.com/pallets/jinja/security/advisories/GHSA-gmj6-6f8f-6699
- https://nvd.nist.gov/vuln/detail/CVE-2024-56201
- https://github.com/pallets/jinja/issues/1792
- https://github.com/pallets/jinja/commit/767b23617628419ae3709ccfb02f9602ae9fe51f
- https://github.com/pallets/jinja
- https://github.com/pallets/jinja/releases/tag/3.1.5
- https://pypi.org/project/jinja2
- https://github.com/advisories/GHSA-gmj6-6f8f-6699
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-150- Platform
- Python (PyPI)
- Package
jinja2- Disclosed
- 23.12.2024
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-1472 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-gmj6-6f8f-6699 - CC BY 4.0
Vulnerability history: jinja2
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 11
- First → latest
- 05.2014 06.2025
- Without a fix
- 1
- Exploited in attacks
- 0
Severity breakdown
- High 4
- Medium 7
Disclosures per year
- 2017: 0
- 2018: 0
- 2019: 2
- 2020: 0
- 2021: 1
- 2022: 0
- 2023: 0
- 2024: 4
- 2025: 2
- 2026: 0
earlier: 2
-
Jinja has a sandbox breakout through malicious filenames this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.