Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2024-56326 on Ubuntu — jinja2

⚪ Unknown ✅ No Known Exploit OSV
N/A
CVSS Score
0 Low4 Medium7 High9 Critical10

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.

Distribution advisory

This page covers CVE-2024-56326 as tracked by Ubuntu, for the package jinja2. The fix is available in version 3.1.2-1ubuntu1.2; earlier versions remain affected.

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs low-level privileges on the target. A user must be tricked into taking some action. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: 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

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: Present — the target has to be in a particular state for the attack to work.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: Passive — a victim action is involved, but not a deliberate one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

UBUNTU-CVE-2024-56326 is classified as CWE-693: Protection Mechanism Failure. A protection exists but does not cover the case at hand, so it can be worked around.

Affected software

UBUNTU-CVE-2024-56326 is recorded against 1 package.

  • jinja2 (fixed in 3.1.2-1ubuntu1.2)

Timeline and source

Published on 23 December 2024 and last revised on 4 February 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

ubuntu.com (Report)
www.cve.org (Report)
github.com (Report)
github.com (Report)
ubuntu.com (Advisory)
ubuntu.com (Advisory)

Other advisories for this package

jinja2 has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-693: Protection Mechanism Failure) in other software:

CVE-2024-56326 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity Unknown
CVSS Score N/A
CVSS Vector 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
CWE N/A
Public Exploit ✅ No
Source OSV
Published 2024-12-23
Updated 2026-08-20
Modified 2026-02-04
Fix URL N/A

Affected Packages

Software From version Fixed in
jinja2 3.1.2-1ubuntu1.2

Site Security Check

Is jinja2 part of your stack?

UBUNTU-CVE-2024-56326 is rated CVSS 7.8 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesUbuntuUbuntu 2024