CVE-2024-56201
Jinja has a sandbox breakout through malicious filenames
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
0Exploited in Wild
-Decision
Descriptions
Jinja is an extensible templating engine. 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.
Jinja es un motor de plantillas extensible. Antes de 3.1.5, un error en el compilador de Jinja permitía a un atacante que controlaba tanto el contenido como el nombre de archivo de una plantilla ejecutar código Python arbitrario, independientemente de si se utilizaba el entorno limitado de Jinja. Para aprovechar la vulnerabilidad, un atacante necesita controlar tanto el nombre del archivo como el contenido de una plantilla. Que ese sea el caso depende del tipo de aplicación que utilice Jinja. Esta vulnerabilidad afecta a los usuarios de aplicaciones que ejecutan plantillas que no son de confianza donde el autor de la plantilla también puede elegir el nombre del archivo de la plantilla. Esta vulnerabilidad se solucionó en 3.1.5.
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.
A flaw was found in the Jinja2 package. 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 Jinja's sandbox being used. An attacker needs to be able 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 that execute untrusted templates where the template author can also choose the template filename.
It was discovered that Jinja2 incorrectly handled certain filenames when compiling template content. An attacker could possibly use this issue to execute arbitrary code. It was discovered that Jinja2 incorrectly handled string formatting calls. An attacker could possibly use this issue to execute arbitrary code.
CVSS Scores
SSVC
- Decision:Track*
Timeline
- 2024-12-18 CVE Reserved
- 2024-12-23 CVE Published
- 2024-12-24 EPSS Updated
- 2025-01-09 CVE Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
- ---------- First Exploit
CWE
- CWE-150: Improper Neutralization of Escape, Meta, or Control Sequences
CAPEC
References (6)
URL | Tag | Source |
---|---|---|
https://github.com/pallets/jinja/commit/767b23617628419ae3709ccfb02f9602ae9fe51f | X_refsource_misc | |
https://github.com/pallets/jinja/issues/1792 | X_refsource_misc | |
https://github.com/pallets/jinja/releases/tag/3.1.5 | X_refsource_misc | |
https://github.com/pallets/jinja/security/advisories/GHSA-gmj6-6f8f-6699 | X_refsource_confirm |
URL | Date | SRC |
---|
URL | Date | SRC |
---|
URL | Date | SRC |
---|---|---|
https://access.redhat.com/security/cve/CVE-2024-56201 | 2025-01-28 | |
https://bugzilla.redhat.com/show_bug.cgi?id=2333854 | 2025-01-28 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Pallets Search vendor "Pallets" | Jinja Search vendor "Pallets" for product "Jinja" | >= 3.0.0 < 3.1.5 Search vendor "Pallets" for product "Jinja" and version " >= 3.0.0 < 3.1.5" | en |
Affected
|