CVE-2024-56201: 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
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-56201?
CVE-2024-56201 is classified as a critical severity vulnerability due to its potential for arbitrary code execution.
How do I fix CVE-2024-56201?
To address CVE-2024-56201, update the Jinja2 package to version 3.1.5 or later.
What causes CVE-2024-56201?
CVE-2024-56201 is caused by a bug in the Jinja compiler that allows execution of arbitrary Python code when an attacker controls the template's content and filename.
Which versions of Jinja2 are affected by CVE-2024-56201?
Versions of Jinja2 from 3.0.0 up to 3.1.4 are affected by CVE-2024-56201.
Can CVE-2024-56201 be exploited in a sandboxed environment?
Yes, CVE-2024-56201 can be exploited even when Jinja's sandbox is used.