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.
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTNIST
7.8 HIGH
LOCAL
LOW
LOW
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHub_MCNA
---
---
CISA-ADPADP
7.8 HIGH
LOCAL
LOW
LOW
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Awaiting analysis
This vulnerability is currently awaiting analysis.
Base Score
CVSS 3.x
EPSS Score
Percentile: 35%
Debian logo
Debian Releases
Debian Product
Codename
jinja2
bullseye
vulnerable
bullseye (security)
2.11.3-1+deb11u4
fixed
bookworm
3.1.2-1+deb12u2
fixed
sid
3.1.6-1
fixed
trixie
3.1.6-1
fixed
Ubuntu logo
Ubuntu Releases
Ubuntu Product
Codename
jinja2
plucky
not-affected
oracular
Fixed 3.1.3-1ubuntu1.24.10.1
released
noble
Fixed 3.1.2-1ubuntu1.2
released
jammy
Fixed 3.0.3-1ubuntu0.3
released
focal
Fixed 2.10.1-2ubuntu0.4
released
bionic
Fixed 2.10-1ubuntu0.18.04.1+esm3
released
xenial
Fixed 2.8-1ubuntu0.1+esm5
released
trusty
Fixed 2.7.2-2ubuntu0.1~esm6
released