Skip to main content
CVE-2024-56326VulnerabilityPublished Updated

CVE-2024-56326: pallets jinja · Improper Neutralization of Special Elements Used in a Template Engine

Affects pallets jinjaSource CVE Database V5

0

Not known to be exploited · CVSS 5.4 Medium : upgrade to 3.1.5 when convenient.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 4.0 base score
5.4Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.5% chance of exploitation in 30 days – higher than 43% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 3.1.5
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 23 Dec 2024

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.

What to do

Upgrade pallets jinja to 3.1.5.

Affected software

ProductAffectedFixed in
PyPIjinjapkg:pypi/jinjaOther threatsAffected
  • <3.1.5
Fixed in
  • 3.1.5

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

1. Upgrade all Jinja installations to version 3.1.5 or later immediately to apply the fix that extends sandbox protections. 2. Audit all applications using Jinja for custom filters, especially those that may invoke str.format or other string formatting methods on user-controlled input. 3. Restrict template editing or uploading capabilities to trusted users only, minimizing the risk of untrusted template injection. 4. Implement strict input validation and sanitization on any user inputs that influence template content. 5. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) with rules targeting suspicious template-related activities. 6. Monitor application logs for unusual template rendering errors or suspicious filter invocations. 7. Educate developers on secure template usage and sandboxing principles to avoid introducing similar vulnerabilities. 8. Consider isolating template rendering environments using containerization or sandboxing at the OS level to limit potential damage from exploitation.

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.

References

Community reviews

Loading reviews…