Summary
Rafal Krupinski discovered that Jinja2 did not properly restrict
the execution of code in situations where templates are used maliciously.
An attacker with control over a template's filename and content could
potentially use this issue to enable the execution of arbitrary code.
This issue only affected Ubuntu 14.04 LTS and Ubuntu 16.04 LTS.
(CVE-2024-56201)
It was discovered that Jinja2 sandboxed environments could be escaped
through a call to a string format method. An attacker could possibly use
this issue to enable the execution of arbitrary code. This issue only
affected Ubuntu 14.04 LTS and Ubuntu 16.04 LTS. (CVE-2024-56326)
It was discovered that Jinja2 sandboxed environments could be escaped
through the malicious use of certain filters. An attacker could possibly
use this issue to enable the execution of arbitrary code. (CVE-2025-27516)
Fixed packages 6
| Release | Package | Fixed in |
|---|---|---|
| Ubuntu · 20.04 LTS 20.04:LTS | jinja2 | 2.10.1-2ubuntu0.5 |
| Ubuntu · 22.04 LTS 22.04:LTS | jinja2 | 3.0.3-1ubuntu0.4 |
| Ubuntu · 24.04 LTS 24.04:LTS | jinja2 | 3.1.2-1ubuntu1.3 |
| Ubuntu · Pro 14.04 LTS Pro:14.04:LTS | jinja2 | 2.7.2-2ubuntu0.1~esm6 |
| Ubuntu · Pro 16.04 LTS Pro:16.04:LTS | jinja2 | 2.8-1ubuntu0.1+esm5 |
| Ubuntu · Pro 18.04 LTS Pro:18.04:LTS | jinja2 | 2.10-1ubuntu0.18.04.1+esm4 |
Vulnerabilities 3
-
Medium 5.4
Jinja has a sandbox breakout through malicious filenames
Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, a bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox…
-
Medium 5.4
Jinja has a sandbox breakout through indirect reference to format method
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…
-
Medium 5.4
Jinja sandbox breakout through attr filter selecting format method
Jinja is an extensible templating engine. Prior to 3.1.6, an oversight in how the Jinja sandboxed environment interacts with the |attr filter allows an attacker that controls the content of a template to execute arbitrary Python code. To exploit the vulnerabi…