CVE-2024-56201
Jinja has a sandbox breakout through malicious filenames
Description
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 is used. To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5.
How to fix CVE-2024-56201
To remediate CVE-2024-56201, upgrade the affected package to a fixed version below.
- —upgrade to 3.1.5-r0 or later
- —upgrade to 3.1.2-1+deb12u2 or later
- —upgrade to 3.1.5 or later
Is CVE-2024-56201 being exploited?
Low — EPSS is 0.6%, meaning exploitation activity has not been observed at scale.
Affected packages (3)
- from 0, < 3.1.5-r0
- from 0, < 3.1.2-1+deb12u2
- >= 3.0.0, < 3.1.5
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 4.0 | — | 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 |
| osv | CVSS 3.1 | HIGH8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |