# CVE-2024-56326: Jinja has a sandbox breakout through indirect reference to format method

- Severity: Medium 5.4 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.52%, higher than 45% of CVEs (2026-12-01)
- Published: 2024-12-23T15:43:49.400Z
- Modified: 2026-09-10T03:50:21.662Z
- Also known as: GHSA-q2x7-8rv6-6q7h, PYSEC-2026-1475
- Weaknesses: CWE-693, CWE-1336
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- pallets jinja: < 3.1.5
- jinja2 (PyPI): before 3.1.5
- palletsprojects jinja: before 3.1.5

## Every score

- GitHub_M: CVSS:4.0 5.4 Medium `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`
- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.8 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:4.0 Medium `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`
- PyPA Advisory Database: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: 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`

## References

- <https://github.com/pallets/jinja/security/advisories/GHSA-q2x7-8rv6-6q7h> (vendor-advisory, web)
- <https://github.com/pallets/jinja/commit/48b0687e05a5466a91cd5812d604fa37ad0943b4> (fix, patch, web)
- <https://github.com/pallets/jinja/releases/tag/3.1.5> (release-notes, web)
- <https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-56326> (advisory)
- <https://github.com/pallets/jinja> (package)
- <https://pypi.org/project/jinja2> (package)
- <https://github.com/advisories/GHSA-q2x7-8rv6-6q7h> (advisory)

## Sources

- CVE List: [CVE-2024-56326](https://www.cve.org/CVERecord?id=CVE-2024-56326), CVE Terms of Use, modified 2025-11-03
- GitHub Advisory Database: [GHSA-q2x7-8rv6-6q7h](https://github.com/advisories/GHSA-q2x7-8rv6-6q7h), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-56326](https://nvd.nist.gov/vuln/detail/CVE-2024-56326), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1475](https://osv.dev/vulnerability/PYSEC-2026-1475), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-56326 · Whole record: https://cve.day/CVE-2024-56326.json · Rebuilt by cve.day 2026-11-25T22:58:50.327Z
