CVE-2024-56326
CVE-2024-56326 is a high-severity vulnerability in Palletsprojects Jinja with a CVSS 3.x base score of 7.8. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-693.
Key facts
- Severity: High (CVSS 3.x base score 7.8)
- CVSS v4: 5.4
- EPSS exploit prediction: 1% (42nd percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2024-3607
- Weakness: CWE-693
- Affected product: Palletsprojects Jinja
- Published:
- Last modified:
Description
Jinja is an extensible templating engine. Prior to 3.1.5, An oversight in how the Jinja sandboxed environment detects calls to str.format allows an attacker that controls the content of a template to execute arbitrary Python code. To exploit the vulnerability, an attacker needs to control the content 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. Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, it's possible to store a reference to a malicious string's format method, then pass that to a filter that calls it. No such filters are built-in to Jinja, but could be present through custom filters in an application. After the fix, such indirect calls are also handled by the sandbox. This vulnerability is fixed in 3.1.5.
Frequently asked questions
- What is CVE-2024-56326?
- Jinja is an extensible templating engine. Prior to 3.1.5, An oversight in how the Jinja sandboxed environment detects calls to str.format allows an attacker that controls the content of a template to execute arbitrary Python code. To exploit the vulnerability, an attacker needs to control the content 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. Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, it's possible to store a reference to a malicious string's format method, then pass that to a filter that calls it. No such filters are built-in to Jinja, but could be present through custom filters in an application. After the fix, such indirect calls are also handled by the sandbox. This vulnerability is fixed in 3.1.5.
- How severe is CVE-2024-56326?
- CVE-2024-56326 has a CVSS 3.x base score of 7.8, rated high severity. It is exploitable over local access with low attack complexity, requires low privileges and no user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2024-56326 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (42nd percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2024-56326?
- CVE-2024-56326 affects Palletsprojects Jinja. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2024-56326?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
- Does CVE-2024-56326 have an EU (EUVD) identifier?
- Yes. CVE-2024-56326 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2024-3607.
- When was CVE-2024-56326 published?
- CVE-2024-56326 was published on 2024-12-23 and last updated on 2026-06-17.
References
- https://github.com/pallets/jinja/commit/48b0687e05a5466a91cd5812d604fa37ad0943b4
- https://github.com/pallets/jinja/releases/tag/3.1.5
- https://github.com/pallets/jinja/security/advisories/GHSA-q2x7-8rv6-6q7h
- https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html
Affected products (1)
- cpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:*
More vulnerabilities in Palletsprojects Jinja
- CVE-2025-27516 — High (CVSS 8.8): Jinja is an extensible templating engine. Prior to 3.1.6, an oversight in how the Jinja sandboxed environment interacts…
- CVE-2024-56201 — High (CVSS 8.8): Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, a bug in the Jinja compiler…
- CVE-2016-10745 — High (CVSS 8.6): In Pallets Jinja before 2.8.1, str.format allows a sandbox escape.
- CVE-2019-10906 — High (CVSS 8.6): In Pallets Jinja before 2.10.1, str.format_map allows a sandbox escape.
- CVE-2024-34064 — Medium (CVSS 5.4): Jinja is an extensible templating engine. The `xmlattr` filter in affected versions of Jinja accepts keys containing…
- CVE-2024-22195 — Medium (CVSS 5.4): Jinja is an extensible templating engine. Special placeholders in the template allow writing code similar to Python…
All CVEs affecting Palletsprojects Jinja →
Other CWE-693 (Protection Mechanism Failure) vulnerabilities
- CVE-2026-93606 — Critical (CVSS 10.0): vm2 (npm) versions 3.12.0 and earlier contain a sandbox escape in `VM` and `NodeVM`. When an embedder exposes a host…
- CVE-2026-93605 — Critical (CVSS 10.0): vm2 NodeVM versions before 3.12.1 contain a sandbox escape vulnerability where the DANGEROUS_BUILTINS denylist omits…
- CVE-2026-92956 — Critical (CVSS 10.0): vm2 versions 3.10.1 through 3.11.6 contain a sandbox escape reachable from a default `new VM()` sandbox when running on…
- CVE-2026-75874 — Critical (CVSS 10.0): Sandbox escape in the Remote Settings Client component. This vulnerability was fixed in Firefox 154, Thunderbird 154,…
- CVE-2026-47140 — Critical (CVSS 10.0): vm2 is an open source vm/sandbox for Node.js. Prior to version 3.11.4, NodeVM blocks several dangerous Node.js builtins…
- CVE-2026-34208 — Critical (CVSS 10.0): SandboxJS is a JavaScript sandboxing library. Prior to 0.8.36, SandboxJS blocks direct assignment to global objects…
Browse all CWE-693 (Protection Mechanism Failure) vulnerabilities →