Cyber Resilience

CVE-2024-56326

Palletsprojects Jinja ≤ 3.1.5

Published
23 December 2024
Modified
03 November 2025
Patch / advisory
CVSS Score v4 5.4
Click a component to see what it means
Raw vectorCVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
EPSS Score 0.0052 42th percentile
Risk Priority 35 floored blend · peak EPSS

Summary

CVE-2024-56326 is a medium-severity Protection Mechanism Failure (CWE-693) vulnerability in Palletsprojects Jinja. Its CVSS base score is 5.4 (Medium).

Operationally, exploitation aligns with the MITRE ATT&CK technique Template Injection (T1221); ranked at the 42th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to AC-3 (Access Enforcement) and AC-4 (Information Flow Enforcement) — see the control section below for these in your framework.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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,…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1221 Template Injection Stealth
Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts.
T1548 Abuse Elevation Control Mechanism Privilege Escalation
Adversaries may circumvent mechanisms designed to control privilege elevation to gain higher-level permissions.
T1553 Subvert Trust Controls Defense Impairment
Adversaries may undermine security controls that will either warn users of untrusted activity or prevent execution of untrusted programs.
T1553.005 Mark-of-the-Web Bypass Defense Impairment
Adversaries may abuse specific file formats to subvert Mark-of-the-Web (MOTW) controls.
T1600 Weaken Encryption Defense Impairment
Adversaries may compromise a network device’s encryption capability in order to bypass encryption that would otherwise protect data communications.
T1689 Downgrade Attack Defense Impairment
Adversaries may downgrade or use a version of system features that may be outdated, vulnerable, and/or does not support updated security controls.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2024-22195Same product: Palletsprojects Jinja
CVE-2024-56201Same product: Palletsprojects Jinja
CVE-2025-27516Same product: Palletsprojects Jinja
CVE-2024-34064Same product: Palletsprojects Jinja
CVE-2023-25577Same vendor: Palletsprojects
CVE-2023-46136Same vendor: Palletsprojects
CVE-2024-49767Same vendor: Palletsprojects
CVE-2023-30861Same vendor: Palletsprojects
CVE-2023-23934Same vendor: Palletsprojects
CVE-2026-27205Same vendor: Palletsprojects

Affected Assets

palletsprojects
jinja
≤ 3.1.5

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 8 hardening rules · 6 OS baselines
Validate
Prove the fix (OWASP ASVS)
  • V1.3.2
  • V1.3.7
  • V1.3.10
  • V6.3.3

Mitigating Controls (NIST 800-53 r5) AI

AC-3 directly requires enforcement of access authorizations via the protection mechanism itself.

AC-4 mandates use of information flow enforcement mechanisms to control data movement.

SC-2 requires separation of user and system functionality as a protection mechanism.

SC-28 requires protection mechanisms for information at rest.

SC-3 requires isolation of security functions from non-security functions.

SC-7 requires boundary protection mechanisms to monitor and control external communications.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.AA-03 mostly match
prevents

Enforcing authentication directly implements a core protection mechanism whose absence or misuse is the CWE.

PR.AA-05 mostly match
prevents

Defining and enforcing access authorizations is a protection mechanism; proper use prevents the CWE.

PR.DS-01 mostly match
prevents

Cryptographic and integrity controls are protection mechanisms whose correct deployment mitigates the CWE.

PR.DS-02 mostly match
prevents

Encryption and integrity protections for transit are explicit protection mechanisms.

PR.IR-01 mostly match
prevents

Logical network protections are protection mechanisms whose failure matches the CWE.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require proper input neutralization in template engines to prevent injection.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing can detect template-injection flaws but does not itself implement neutralization controls.

finds

Systematic verification that security mechanisms operate according to defined standards reduces the likelihood that protection mechanisms are bypassed or disabled.

mitigates

Hardening devices, disabling vulnerable protocols, and maintaining accurate network diagrams reduce the likelihood that a protection mechanism is misconfigured or left in a weak state.

prevents

Secure development life cycle mandates input validation and sanitization that directly prevents template-injection weaknesses.

prevents

Application security requirements explicitly call for neutralizing special elements in template engines.

prevents

Secure architecture principles reduce the likelihood of unsafe template processing but do not prescribe specific neutralization techniques.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

Oracle Linux 8 (2 rules)
  • V-248524 OL 8 must implement NIST FIPS-validated cryptography for the following: To provision digital signatures, to generate cryptographic hashes, and to protect data requiring data-at-rest protections in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards. prevents CWE-693
  • V-248525 All OL 8 local disk partitions must implement cryptographic mechanisms to prevent unauthorized disclosure or modification of all information that requires at-rest protection. prevents CWE-693
Windows 10 (2 rules)
  • V-220865 The Windows Remote Management (WinRM) service must not use Basic authentication. prevents CWE-693
  • V-220812 Credential Guard must be running on Windows 10 domain-joined systems. prevents CWE-693
Windows 11 (1 rule)
  • V-253418 The Windows Remote Management (WinRM) service must not use Basic authentication. prevents CWE-693
Windows Server 2016 (1 rule)
  • V-225012 Windows Server 2016 must be running Credential Guard on domain-joined member servers. prevents CWE-693
Windows Server 2019 (1 rule)
  • V-205907 Windows Server 2019 must be running Credential Guard on domain-joined member servers. prevents CWE-693
Windows Server 2022 (1 rule)
  • V-254441 Windows Server 2022 must be running Credential Guard on domain-joined member servers. prevents CWE-693

References