{"id":"CVE-2024-56201","published":"2024-12-23T15:37:36Z","modified":"2025-02-18T21:47:42Z","title":"Jinja has a sandbox breakout through malicious filenames","vendor":"pallets","product":"jinja","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00307,"percentile":0.24117,"provenance":"source"},"cwes":[{"id":"CWE-150","name":"Improper Neutralization of Escape, Meta, or Control Sequences"}],"references":[{"url":"https://github.com/pallets/jinja/security/advisories/GHSA-gmj6-6f8f-6699","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/pallets/jinja/issues/1792","tags":["x_refsource_MISC"]},{"url":"https://github.com/pallets/jinja/commit/767b23617628419ae3709ccfb02f9602ae9fe51f","tags":["x_refsource_MISC"]},{"url":"https://github.com/pallets/jinja/releases/tag/3.1.5","tags":["x_refsource_MISC"]}],"priority":{"score":8.6,"factors":[{"name":"EPSS percentile","points":4.82},{"name":"CVSS severity","points":3.78}]},"vendorSlug":"pallets","affectedVersions":[{"vendor":"pallets","product":"jinja","versions":[">= 3.0.0, < 3.1.5"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-12-24T01:44:55.825619Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"jinja2","vulnerableRanges":[">=3.0.0, <3.1.5"],"patched":["3.1.5"],"from":["GHSA-gmj6-6f8f-6699","PYSEC-2026-1472"],"provenance":"source"}],"summary":{"text":"The Jinja templating engine, from Pallets, has a flaw in its compiler in versions on the 3.x branch prior to 3.1.5, which lets a template's content and filename be abused to run arbitrary Python code. An attacker needs local access and must control both the contents and the filename of a template, which is only possible in applications that run untrusted templates while letting the template author choose the filename, and it works even when Jinja's sandbox is enabled.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:11:02Z"},"euvd":{"id":"EUVD-2024-3585","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-22195","published":"2024-01-11","fixed":"3.1.3","kev":false,"link":{"from":"CVE-2024-22195","to":"CVE-2024-56201","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:jinja2","fromFixed":"3.1.3","toFixed":"3.1.5","daysApart":347}]}},{"cve":"CVE-2024-56201","published":"2024-12-23","fixed":"3.1.5","kev":false},{"cve":"CVE-2024-56326","published":"2024-12-23","fixed":"3.1.5","kev":false}],"package":"PyPI:jinja2"}}