CVE-2024-56326
highpriority · track · 0EPSS 0.005 · 44 %ileDEEURUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · low–high · 2–7.8
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (59)
Products and version ranges known to be affected.
- IBM InfoSphere Information Server 11.7all versionscert_bundDEcpe:/a:ibm:infosphere_information_server:11.7
- Red Hat Ansible Automation Platformall versionscert_bundDEcpe:/a:redhat:ansible_automation_platform:-
- Red Hat Ansible Automation Platform 2.4all versionscert_bundDEcpe:/a:redhat:ansible_automation_platform:2.4
- Red Hat Ansible Automation Platform Container Releaseall versionscert_bundDEcpe:/a:redhat:ansible_automation_platform:::container_release
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2025-0054Red Hat Enterprise Linux (Jinja): Mehrere Schwachstellen ermöglichen CodeausführungDeutsch2025-01-13csaf · cert_bundDE
Ein lokaler Angreifer kann mehrere Schwachstellen in Red Hat Enterprise Linux, Red Hat Ansible Automation Platform und Red Hat OpenShift ausnutzen, um beliebigen Programmcode auszuführen.
- GHSA-q2x7-8rv6-6q7hJinja has a sandbox breakout through indirect reference to format method2024-12-23ghsa · osvUS
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.
- PYSEC-2026-1475Jinja has a sandbox breakout through indirect reference to format method2026-07-07vendor · osvUS
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.
also known as (7)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (12)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2024-56326cnnvd
- https://github.com/pallets/jinja/commit/48b0687e05a5466a91cd5812d604fa37ad0943b4cnnvd
- https://github.com/pallets/jinja/releases/tag/3.1.5cnnvd
- https://github.com/pallets/jinja/security/advisories/GHSA-q2x7-8rv6-6q7hcnnvd
- https://vigilance.fr/vulnerability/Jinja-code-execution-via-str-format-45995cnnvd
- https://github.com/pallets/jinja/commit/48b0687e05a5466a91cd5812d604fa37ad0943b4enisa_euvd
- https://github.com/pallets/jinja/releases/tag/3.1.5enisa_euvd
- https://github.com/pallets/jinja/security/advisories/GHSA-q2x7-8rv6-6q7henisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan