{"cve":"CVE-2024-56326","nvd":{"published":"2024-12-23T16:15:07.590","modified":"2026-06-17T08:12:03.003","status":"Modified","description":"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_v4":{"vector":"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","score":5.4},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8},"cwes":["CWE-693","CWE-1336"],"references":["https://github.com/pallets/jinja/commit/48b0687e05a5466a91cd5812d604fa37ad0943b4","https://github.com/pallets/jinja/releases/tag/3.1.5","https://github.com/pallets/jinja/security/advisories/GHSA-q2x7-8rv6-6q7h","https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html"],"products":["palletsprojects:jinja"],"source":"nvd","synced_at":"2026-10-19T21:57:56.913276502+00:00"},"epss":{"cve":"CVE-2024-56326","score":0.00522,"percentile":0.44297,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-q2x7-8rv6-6q7h","url":"https://osv.dev/vulnerability/GHSA-q2x7-8rv6-6q7h","summary":"Jinja has a sandbox breakout through indirect reference to format method","modified":"2026-09-10T03:50:21.662855250Z","packages":[{"ecosystem":"PyPI","name":"jinja2","purl":"pkg:pypi/jinja2","ranges":["<3.1.5"],"fixed":["3.1.5"]}]},{"id":"PYSEC-2026-1475","url":"https://osv.dev/vulnerability/PYSEC-2026-1475","summary":"Jinja has a sandbox breakout through indirect reference to format method","modified":"2026-07-07T17:46:13.842466429Z","packages":[{"ecosystem":"PyPI","name":"jinja2","purl":"pkg:pypi/jinja2","ranges":["<3.1.5"],"fixed":["3.1.5"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}