{"answers":{"affected":"2 open source packages ship an affected version, including langchain. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-7774 exists.","fix":"Upgrade langchain to 0.2.19 or later.","what":"CVE-2024-7774 is a medium-severity path traversal vulnerability in langchain-ai/langchainjs, published on 29 Oct 2024. 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-7774 and fix it if it is affected.\n\nWhat it is: CVE-2024-7774 is a medium-severity path traversal vulnerability in langchain-ai/langchainjs, published on 29 Oct 2024. 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-7774 exists.\n\nAffected packages and fixed versions:\n- langchain (npm): affected all versions; fixed in 0.2.19\n- langchain (npm): affected all versions; fixed in 0.2.19\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-7774/ (Markdown: https://insights.sbomify.com/CVE-2024-7774/index.md)","id":"CVE-2024-7774","markdown":"https://insights.sbomify.com/CVE-2024-7774/index.md","name":"CVE-2024-7774","record":{"aliases":["CLEANSTART-2026-JM92402","ECHO-ab50-0af1-5eb2","GHSA-hc5w-c9f8-9cc4","MINI-rqmp-4223-m4gp"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript AI library","requires_auth":"none","summary":"Attackers can traverse directories to read, overwrite, or delete files via unsanitized input in langchainjs methods.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntr_ai","cpe":[{"product":"langchain.js","vendor":"langchain"}],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","version":"3.0"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-29","name":"Path Traversal: '\\..\\filename'"}],"description":"A path traversal vulnerability exists in the `getFullPath` method of langchain-ai/langchainjs version 0.2.5. This vulnerability allows attackers to save files anywhere in the filesystem, overwrite existing text files, read `.txt` files, and delete files. The vulnerability is exploited through the `setFileContent`, `getParsedFile`, and `mdelete` methods, which do not properly sanitize user input.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Path Traversal in langchain-ai/langchainjs","id":"CVE-2024-7774","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"path_traversal","year":"2024"},"n_packages":2,"n_references":2,"next":{"headline":"File upload in Contact Form by Bit Form: Multi Step Form, Calculation Contact Form, Payment Contact Form \u0026 Custom Contact Form builder","id":"CVE-2024-7775"},"packages":[{"ecosystem":"npm","fixed":["0.2.19"],"introduced":["0"],"last_affected":[],"package":"langchain","purl":null,"source":"GHSA-hc5w-c9f8-9cc4"},{"ecosystem":"npm","fixed":["0.2.19"],"introduced":["0"],"last_affected":[],"package":"langchain","purl":"pkg:npm/langchain","source":"GHSA-hc5w-c9f8-9cc4"}],"prev":{"headline":"Jupiter X Core \u003c= 4.6.5 - Unauthenticated Arbitrary File Upload","id":"CVE-2024-7772"},"products":["langchain-ai/langchainjs"],"published":"2024-10-29","related":[{"cvss_score":8.6,"headline":"LangChain serialization injection vulnerability enables secret extraction","id":"CVE-2025-68665","kev_date_added":null,"published":"2025-12-23"}],"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":"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":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-10-29","vendors":["langchain-ai"]},"summary":"Attackers can traverse directories to read, overwrite, or delete files via unsanitized input in langchainjs methods.","url":"https://insights.sbomify.com/CVE-2024-7774/"}