CVE-2024-56201
MEDIUM 5.4CVSS 4.0Jinja has a sandbox breakout through malicious filenames
Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, 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. This vulnerability is fixed in 3.1.5.
- Published
- 23 Dec 2024
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-150
- Also known as
- GHSA-gmj6-6f8f-6699PYSEC-2026-1472
- Sources
- NVDJSONOSV GHSA-gmj6-6f8f-6699JSONOSV PYSEC-2026-1472JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | MEDIUM 5.4 | 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/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 | GitHub | CVSS 4.0 | 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 | |
| OSV | PyPA | CVSS 4.0 | 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 | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | palletsprojects | jinjacpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:* |
>= 3.0.0, < 3.1.5 | 3.1.5 |
| OSV | PyPI | jinja2 | >= 3.0.0, < 3.1.5 | 3.1.5 |
References
- https://github.com/pallets/jinja/commit/767b23617628419ae3709ccfb02f9602ae9fe51f · Patch, WEB, FIX
- https://github.com/pallets/jinja/issues/1792 · Issue Tracking, WEB
- https://github.com/pallets/jinja/releases/tag/3.1.5 · Release Notes, WEB
- https://github.com/pallets/jinja/security/advisories/GHSA-gmj6-6f8f-6699 · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-56201 · ADVISORY
- https://github.com/pallets/jinja · PACKAGE
- https://pypi.org/project/jinja2 · PACKAGE
- https://github.com/advisories/GHSA-gmj6-6f8f-6699 · ADVISORY
History
- 25 Nov 2026 20:57 UTC · NVD: first stored (published 23 Dec 2024)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 7 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 23 Dec 2024)