{"answers":{"affected":"7 open source packages ship an affected version, including langchain-core.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-10940 exists.","fix":"Upgrade langchain-core to a fixed version for your release line: 0.1.53, 0.2.43 or 0.3.15.","what":"CVE-2024-10940 is a medium-severity path traversal vulnerability in langchain-ai/langchain, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-10940 and fix it if it is affected.\n\nWhat it is: CVE-2024-10940 is a medium-severity path traversal vulnerability in langchain-ai/langchain, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-10940 exists.\n\nAffected packages and fixed versions:\n- langchain-core (PyPI): affected from 0.1.17; fixed in 0.1.53, 0.2.43, 0.3.15\n- langchain-core (PyPI): affected from 0.1.17; fixed in 0.1.53\n- langchain-core (PyPI): affected from 0.1.17; fixed in 0.1.53\n- langchain-core (PyPI): affected from 0.2.0; fixed in 0.2.43\n- langchain-core (PyPI): affected from 0.2.0; fixed in 0.2.43\n- langchain-core (PyPI): affected from 0.3.0; fixed in 0.3.15\n- langchain-core (PyPI): affected from 0.3.0; fixed in 0.3.15\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-10940/ (Markdown: https://insights.sbomify.com/CVE-2024-10940/index.md)","id":"CVE-2024-10940","markdown":"https://insights.sbomify.com/CVE-2024-10940/index.md","name":"CVE-2024-10940","record":{"aliases":["ECHO-db43-5462-956d","GHSA-5chr-fjjv-38qv","PYSEC-2026-1517"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Python AI library","requires_auth":"none","summary":"Attackers can read arbitrary files from the host file system via ImagePromptTemplate input variables, exposing sensitive information if outputs are visible.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntr_ai","cpe":[],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","version":"3.0"},"cwes":[{"id":"CWE-497","name":"Exposure of Sensitive System Information to an Unauthorized Control Sphere"}],"description":"A vulnerability in langchain-core versions \u003e=0.1.17,\u003c0.1.53, \u003e=0.2.0,\u003c0.2.43, and \u003e=0.3.0,\u003c0.3.15 allows unauthorized users to read arbitrary files from the host file system. The issue arises from the ability to create langchain_core.prompts.ImagePromptTemplate's (and by extension langchain_core.prompts.ChatPromptTemplate's) with input variables that can read any user-specified path from the server file system. If the outputs of these prompt templates are exposed to the user, either directly or through downstream model outputs, it can lead to the exposure of sensitive information.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Exposure of Sensitive System Information via ImagePromptTemplate in langchain-ai/langchain","id":"CVE-2024-10940","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2024"},"n_packages":7,"n_references":2,"next":{"headline":"Denial of service in Firefox","id":"CVE-2024-10941"},"packages":[{"ecosystem":"PyPI","fixed":["0.1.53","0.2.43","0.3.15"],"introduced":["0.1.17","0.2.0","0.3.0"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"PYSEC-2026-1517"},{"ecosystem":"PyPI","fixed":["0.1.53"],"introduced":["0.1.17"],"last_affected":[],"package":"langchain-core","purl":null,"source":"GHSA-5chr-fjjv-38qv"},{"ecosystem":"PyPI","fixed":["0.1.53"],"introduced":["0.1.17"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"GHSA-5chr-fjjv-38qv"},{"ecosystem":"PyPI","fixed":["0.2.43"],"introduced":["0.2.0"],"last_affected":[],"package":"langchain-core","purl":null,"source":"GHSA-5chr-fjjv-38qv"},{"ecosystem":"PyPI","fixed":["0.2.43"],"introduced":["0.2.0"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"GHSA-5chr-fjjv-38qv"},{"ecosystem":"PyPI","fixed":["0.3.15"],"introduced":["0.3.0"],"last_affected":[],"package":"langchain-core","purl":null,"source":"GHSA-5chr-fjjv-38qv"},{"ecosystem":"PyPI","fixed":["0.3.15"],"introduced":["0.3.0"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"GHSA-5chr-fjjv-38qv"}],"prev":{"headline":"Image Widget \u003c 4.4.11 - Admin+ Stored XSS","id":"CVE-2024-10939"},"products":["langchain-ai/langchain"],"published":"2025-03-20","related":[],"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":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-03-20","vendors":["langchain-ai"]},"summary":"Attackers can read arbitrary files from the host file system via ImagePromptTemplate input variables, exposing sensitive information if outputs are visible.","url":"https://insights.sbomify.com/CVE-2024-10940/"}