{"answers":{"affected":"3 open source packages ship an affected version, including jinja2. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-56326 in the wild and no public exploit code.","fix":"Upgrade jinja2 to 3.1.5 or later.","what":"CVE-2024-56326 is a medium-severity code injection vulnerability in pallets jinja, published on 23 Dec 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2024-56326 and fix it if it is affected.\n\nWhat it is: CVE-2024-56326 is a medium-severity code injection vulnerability in pallets jinja, published on 23 Dec 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2024-56326 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- jinja2 (PyPI): affected all versions; fixed in 3.1.5\n- jinja2 (PyPI): affected all versions; fixed in 3.1.5\n- jinja2 (PyPI): affected all versions; fixed in 3.1.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-56326/ (Markdown: https://insights.sbomify.com/CVE-2024-56326/index.md)","id":"CVE-2024-56326","markdown":"https://insights.sbomify.com/CVE-2024-56326/index.md","name":"CVE-2024-56326","record":{"aliases":["ALPINE-CVE-2024-56326","ALSA-2025:0667","ALSA-2025:0711","AZL-54647","AZL-54654","BELL-CVE-2024-56326","CLEANSTART-2026-RN39898","CLEANSTART-2026-UE72338","CLSA-2025-1765287413","CLSA-2025-1765310613","DEBIAN-CVE-2024-56326","ECHO-1d31-dacb-27da","GHSA-q2x7-8rv6-6q7h","MGASA-2025-0050","MINI-3897-9vq6-f7pc","MINI-p3gx-8p24-qq24","OESA-2024-2597","OESA-2024-2598","PYSEC-2026-1475","RHSA-2025:0667","RHSA-2025:0711","RHSA-2025:0850","RHSA-2025:0883","RHSA-2025:0950","RHSA-2025:0951","RHSA-2025:0978","RHSA-2025:1109","RHSA-2025:1250","RHSA-2025:2612","RLSA-2025:0667","RLSA-2025:0711","ROOT-APP-PYPI-CVE-2024-56326","SUSE-SU-2025:0016-1","SUSE-SU-2025:0029-1","UBUNTU-CVE-2024-56326"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Python templating library","requires_auth":"low_privilege","summary":"Attackers controlling template content can execute arbitrary Python code via sandbox bypass if custom filters are present.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"jinja","vendor":"palletsprojects"}],"cvss":{"score":5.4,"severity":"medium","source":"cna","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","version":"4.0"},"cwes":[{"id":"CWE-693","name":"Protection Mechanism Failure"},{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"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.","ecosystems":["AlmaLinux:8","AlmaLinux:9","PyPI","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:9::appstream","Red Hat:rhel_aus:8.2::appstream","Red Hat:rhel_aus:8.4::appstream","Red Hat:rhel_aus:8.6::appstream","Red Hat:rhel_e4s:8.4::appstream","Red Hat:rhel_e4s:8.6::appstream","Red Hat:rhel_e4s:9.0::appstream","Red Hat:rhel_els:7","Red Hat:rhel_eus:8.8::appstream","Red Hat:rhel_eus:9.2::appstream","Red Hat:rhel_eus:9.4::appstream","Red Hat:rhel_tus:8.4::appstream","Red Hat:rhel_tus:8.6::appstream","Rocky Linux:8","Rocky Linux:9","SUSE:Enterprise Storage 7.1","SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS","SUSE:Linux Enterprise Micro 5.1","SUSE:Linux Enterprise Micro 5.2","SUSE:Linux Enterprise Micro 5.3","SUSE:Linux Enterprise Micro 5.4","SUSE:Linux Enterprise Micro 5.5","SUSE:Linux Enterprise Module for Basesystem 15 SP6","SUSE:Linux Enterprise Module for Public Cloud 12","SUSE:Linux Enterprise Server 15 SP3-LTSS","SUSE:Linux Enterprise Server 15 SP4-LTSS","SUSE:Linux Enterprise Server 15 SP5-LTSS","SUSE:Linux Enterprise Server for SAP Applications 15 SP3","SUSE:Linux Enterprise Server for SAP Applications 15 SP4","SUSE:Linux Enterprise Server for SAP Applications 15 SP5","SUSE:Manager Client Tools 12","SUSE:Manager Proxy 4.3","SUSE:Manager Server 4.3","openSUSE:Leap 15.5","openSUSE:Leap Micro 5.5"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Jinja has a sandbox breakout through indirect reference to format method","id":"CVE-2024-56326","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":58,"n_references":3,"next":{"headline":"Malicious plugin names, recipients, or identities can cause arbitrary binary execution in pyrage","id":"CVE-2024-56327"},"packages":[{"ecosystem":"PyPI","fixed":["3.1.5"],"introduced":["0"],"last_affected":[],"package":"jinja2","purl":null,"source":"GHSA-q2x7-8rv6-6q7h"},{"ecosystem":"PyPI","fixed":["3.1.5"],"introduced":["0"],"last_affected":[],"package":"jinja2","purl":"pkg:pypi/jinja2","source":"GHSA-q2x7-8rv6-6q7h"},{"ecosystem":"PyPI","fixed":["3.1.5"],"introduced":["0"],"last_affected":[],"package":"jinja2","purl":"pkg:pypi/jinja2","source":"PYSEC-2026-1475"},{"ecosystem":"AlmaLinux:8","fixed":["2.10.1-6.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/almalinux/python3-jinja2","source":"ALSA-2025:0711"},{"ecosystem":"AlmaLinux:9","fixed":["2.11.3-7.el9_5"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/almalinux/python3-jinja2","source":"ALSA-2025:0667"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:2.10.1-6.el8_10"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0711"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:2.10.1-6.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0711"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:2.11.3-7.el9_5"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0667"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:2.11.3-7.el9_5"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0667"},{"ecosystem":"Red Hat:rhel_aus:8.2::appstream","fixed":["0:2.10.1-2.el8_2.3"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:2612"},{"ecosystem":"Red Hat:rhel_aus:8.2::appstream","fixed":["0:2.10.1-2.el8_2.3"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:2612"},{"ecosystem":"Red Hat:rhel_aus:8.4::appstream","fixed":["0:2.10.1-2.el8_4.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:1109"},{"ecosystem":"Red Hat:rhel_aus:8.4::appstream","fixed":["0:2.10.1-2.el8_4.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:1109"},{"ecosystem":"Red Hat:rhel_aus:8.6::appstream","fixed":["0:2.10.1-4.el8_6.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0950"},{"ecosystem":"Red Hat:rhel_aus:8.6::appstream","fixed":["0:2.10.1-4.el8_6.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0950"},{"ecosystem":"Red Hat:rhel_e4s:8.4::appstream","fixed":["0:2.10.1-2.el8_4.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:1109"},{"ecosystem":"Red Hat:rhel_e4s:8.4::appstream","fixed":["0:2.10.1-2.el8_4.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:1109"},{"ecosystem":"Red Hat:rhel_e4s:8.6::appstream","fixed":["0:2.10.1-4.el8_6.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0950"},{"ecosystem":"Red Hat:rhel_e4s:8.6::appstream","fixed":["0:2.10.1-4.el8_6.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0950"},{"ecosystem":"Red Hat:rhel_e4s:9.0::appstream","fixed":["0:2.11.3-4.el9_0.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0951"},{"ecosystem":"Red Hat:rhel_e4s:9.0::appstream","fixed":["0:2.11.3-4.el9_0.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0951"},{"ecosystem":"Red Hat:rhel_els:7","fixed":["0:2.7.2-5.el7_9"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:1250"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:2.10.1-4.el8_8.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0883"},{"ecosystem":"Red Hat:rhel_eus:8.8::appstream","fixed":["0:2.10.1-4.el8_8.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0883"},{"ecosystem":"Red Hat:rhel_eus:9.2::appstream","fixed":["0:2.11.3-4.el9_2.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0978"},{"ecosystem":"Red Hat:rhel_eus:9.2::appstream","fixed":["0:2.11.3-4.el9_2.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0978"},{"ecosystem":"Red Hat:rhel_eus:9.4::appstream","fixed":["0:2.11.3-6.el9_4"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0850"},{"ecosystem":"Red Hat:rhel_eus:9.4::appstream","fixed":["0:2.11.3-6.el9_4"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0850"},{"ecosystem":"Red Hat:rhel_tus:8.4::appstream","fixed":["0:2.10.1-2.el8_4.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:1109"},{"ecosystem":"Red Hat:rhel_tus:8.4::appstream","fixed":["0:2.10.1-2.el8_4.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:1109"},{"ecosystem":"Red Hat:rhel_tus:8.6::appstream","fixed":["0:2.10.1-4.el8_6.1"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:0950"},{"ecosystem":"Red Hat:rhel_tus:8.6::appstream","fixed":["0:2.10.1-4.el8_6.1"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:0950"},{"ecosystem":"Rocky Linux:8","fixed":["0:2.10.1-6.el8_10"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/rocky-linux/python-jinja2?distro=rocky-linux-8-x86-64\u0026epoch=0","source":"RLSA-2025:0711"},{"ecosystem":"Rocky Linux:9","fixed":["0:2.11.3-7.el9_5"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/rocky-linux/python-jinja2?distro=rocky-linux-9-x86-64\u0026epoch=0","source":"RLSA-2025:0667"},{"ecosystem":"SUSE:Enterprise Storage 7.1","fixed":["2.10.1-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"python-Jinja2","purl":"pkg:rpm/suse/python-Jinja2\u0026distro=SUSE%20Enterprise%20Storage%207.1","source":"SUSE-SU-2025:0029-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","fixed":["2.10.1-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"python-Jinja2","purl":"pkg:rpm/suse/python-Jinja2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSS","source":"SUSE-SU-2025:0029-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","fixed":["2.10.1-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"python-Jinja2","purl":"pkg:rpm/suse/python-Jinja2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOS","source":"SUSE-SU-2025:0029-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","fixed":["2.10.1-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"python-Jinja2","purl":"pkg:rpm/suse/python-Jinja2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSS","source":"SUSE-SU-2025:0029-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS","fixed":["2.10.1-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"python-Jinja2","purl":"pkg:rpm/suse/python-Jinja2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP5-ESPOS","source":"SUSE-SU-2025:0029-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS","fixed":["2.10.1-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"python-Jinja2","purl":"pkg:rpm/suse/python-Jinja2\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP5-LTSS","source":"SUSE-SU-2025:0029-1"}],"prev":{"headline":"Apache Pinot: Authentication bypass issue. If the path does not contain / and contain . authentication is not required","id":"CVE-2024-56325"},"products":["jinja"],"published":"2024-12-23","related":[{"cvss_score":8.6,"headline":"Jinja2 sandbox escape vulnerability","id":"CVE-2016-10745","kev_date_added":null,"published":"2019-04-08"},{"cvss_score":5.4,"headline":"Jinja has a sandbox breakout through malicious filenames","id":"CVE-2024-56201","kev_date_added":null,"published":"2024-12-23"},{"cvss_score":5.4,"headline":"Jinja vulnerable to Cross-Site Scripting (XSS)","id":"CVE-2024-22195","kev_date_added":null,"published":"2024-01-11"}],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"class":"attribution","licence":"BSD","name":"Rocky Linux","prefix":"RLSA"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-11-03","vendors":["pallets"]},"summary":"Attackers controlling template content can execute arbitrary Python code via sandbox bypass if custom filters are present.","url":"https://insights.sbomify.com/CVE-2024-56326/"}