{"id":"GHSA-hc5w-c9f8-9cc4","summary":"Langchain Path Traversal vulnerability","details":"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.","aliases":["CVE-2024-7774"],"modified":"2026-08-07T08:12:27.358969759Z","published":"2024-10-29T15:32:05Z","database_specific":{"cwe_ids":["CWE-22","CWE-29"],"github_reviewed_at":"2024-10-29T19:40:07Z","github_reviewed":true,"nvd_published_at":"2024-10-29T13:15:09Z","severity":"MODERATE"},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-7774"},{"type":"WEB","url":"https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9"},{"type":"PACKAGE","url":"https://github.com/langchain-ai/langchainjs"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml"},{"type":"WEB","url":"https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee"}],"affected":[{"package":{"name":"langchain","ecosystem":"npm","purl":"pkg:npm/langchain"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.2.19"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-hc5w-c9f8-9cc4/GHSA-hc5w-c9f8-9cc4.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"},{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"}]}