Skip to main content

CVE-2024-56201 — Vulnerability in jinja2 — CVE Details

MEDIUM

Jinja has a sandbox breakout through malicious filenames

Published December 23, 2024Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.37%). Schedule for your next planned update.

Does your project use an affected jinja2 version?

Paste your requirements.txt to check it for CVE-2024-56201 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my requirements.txt

Summary

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.

Advisory Timeline

  • First published December 23, 2024 (703 days ago).
  • Last revised September 10, 2026 — 625 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

pip
Update jinja2 to 3.1.5 or later
pip install "jinja2>=3.1.5"

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: PyPI (1).

PackageFixed In
jinja2 PyPI · Affected: 3.0.0, 3.0.1, 3.0.2, 3.0.3 (+5 more)3.1.5

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2024-56201?
Jinja has a sandbox breakout through malicious filenames. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 8.8/10).
How do I check if my project is affected by CVE-2024-56201?
CVE-2024-56201 affects jinja2. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-56201 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.8

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.37%
EPSS percentile: 22.9

This is a below-median EPSS score — only 22.9% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-gmj6-6f8f-6699
PYSEC-2026-1472

Related CVEs

  • CVE-2025-27516
    HIGH

    Jinja2 vulnerable to sandbox breakout through attr filter selecting format method

  • CVE-2024-56326
    HIGH

    Jinja has a sandbox breakout through indirect reference to format method

  • CVE-2024-34064
    MEDIUM

    Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

  • CVE-2026-129221
    MEDIUM

    NLTK: ARFF_Formatter Injects Weka ARFF Schema Directives via Attacker-Controlled Class Labels

  • CVE-2025-27516
    MEDIUM

    Jinja2 vulnerable to sandbox breakout through attr filter selecting format method

  • CVE-2024-34064
    MEDIUM

    Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

  • CVE-2026-128140
    MEDIUM

    NLTK: Downloader cyclic collection indices cause an infinite closure walk

  • CVE-2024-56326
    MEDIUM

    Jinja has a sandbox breakout through indirect reference to format method

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my requirements.txt