{"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-56201 in the wild and no public exploit code.","fix":"Upgrade jinja2 to 3.1.5 or later.","what":"CVE-2024-56201 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-56201 and fix it if it is affected.\n\nWhat it is: CVE-2024-56201 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-56201 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- jinja2 (PyPI): affected from 3.0.0; fixed in 3.1.5\n- jinja2 (PyPI): affected from 3.0.0; fixed in 3.1.5\n- jinja2 (PyPI): affected from 3.0.0; 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-56201/ (Markdown: https://insights.sbomify.com/CVE-2024-56201/index.md)","id":"CVE-2024-56201","markdown":"https://insights.sbomify.com/CVE-2024-56201/index.md","name":"CVE-2024-56201","record":{"aliases":["ALPINE-CVE-2024-56201","AZL-54650","AZL-54660","BELL-CVE-2024-56201","CLEANSTART-2026-JN63910","CLEANSTART-2026-WJ72873","DEBIAN-CVE-2024-56201","ECHO-2933-1e79-af27","GHSA-gmj6-6f8f-6699","MINI-hxxc-qr7w-7vxc","MINI-vxwv-h4m4-mr94","OESA-2025-1007","OESA-2025-1008","PYSEC-2026-1472","ROOT-APP-PYPI-CVE-2024-56201","UBUNTU-CVE-2024-56201"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python templating library","requires_auth":"low_privilege","summary":"Attackers controlling template filename and content can execute arbitrary Python code, bypassing Jinja's sandbox in affected versions.","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-150","name":"Improper Neutralization of Escape, Meta, or Control Sequences"}],"description":"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.","ecosystems":["PyPI"],"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 malicious filenames","id":"CVE-2024-56201","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":3,"n_references":4,"next":{"headline":"Apache Traffic Server: Expect header field can unreasonably retain resource","id":"CVE-2024-56202"},"packages":[{"ecosystem":"PyPI","fixed":["3.1.5"],"introduced":["3.0.0"],"last_affected":[],"package":"jinja2","purl":null,"source":"GHSA-gmj6-6f8f-6699"},{"ecosystem":"PyPI","fixed":["3.1.5"],"introduced":["3.0.0"],"last_affected":[],"package":"jinja2","purl":"pkg:pypi/jinja2","source":"GHSA-gmj6-6f8f-6699"},{"ecosystem":"PyPI","fixed":["3.1.5"],"introduced":["3.0.0"],"last_affected":[],"package":"jinja2","purl":"pkg:pypi/jinja2","source":"PYSEC-2026-1472"}],"prev":{"headline":"Uncontrolled Recursion and Asymmetric Resource Consumption in Altair media/file proxy","id":"CVE-2024-56200"},"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 indirect reference to format method","id":"CVE-2024-56326","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":"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":"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-02-18","vendors":["pallets"]},"summary":"Attackers controlling template filename and content can execute arbitrary Python code, bypassing Jinja's sandbox in affected versions.","url":"https://insights.sbomify.com/CVE-2024-56201/"}