CVE-2024-56201: Jinja has a sandbox breakout through malicious filenames

Published Dec 23, 2024
·
Updated

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

4 affected componentsFixes available
pip/jinja2>=3.0.0<=3.1.4
3.1.5
debian/jinja2
2.11.3-12.11.3-1+deb11u43.1.2-1+deb12u23.1.6-1
IBM Concert Software<=1.0.0-1.1.0
palletsprojects Jinja>=3.0.0<3.1.5

Event History

Dec 23, 2024
CVE Published
via MITRE·03:37 PM
Data Sourced
via MITRE·03:37 PM
DescriptionWeakness
Data Sourced
via Red Hat·04:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 PM
RemedyAffected Software
Advisory Published
via GitHub·05:54 PM
Mar 16, 2025
Data Sourced
via Ubuntu·11:39 AM
RemedyDescriptionSeverityAffected Software
Aug 18, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Apr 28, 58283
Event
via NVD·02:57 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

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.

2

How do I fix CVE-2024-56201?

To address CVE-2024-56201, update the Jinja2 package to version 3.1.5 or later.

3

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.

4

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.

5

Can CVE-2024-56201 be exploited in a sandboxed environment?

Yes, CVE-2024-56201 can be exploited even when Jinja's sandbox is used.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203