{"id":"CVE-2024-7774","aliases":["EUVD-2024-0091","GHSA-hc5w-c9f8-9cc4","PYSEC-2024-111"],"status":"published","title":"Path Traversal in langchain-ai/langchainjs","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.","severity":{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00557,"percentile":0.46702,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22","CWE-29"],"published":"2024-10-29T12:49:21Z","modified":"2026-10-28T02:30:32Z","fixes":[{"ecosystem":"npm","package":"langchain","fixed_in":["0.2.19"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"langchain","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.19"}]}]},{"source":"osv","ecosystem":"npm","package":"langchain","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.2.19"}]}]}],"products":[{"vendor":"langchain","product":"langchain.js"},{"vendor":"langchain-ai","product":"langchain-ai/langchainjs"},{"vendor":"langchain-ai","product":"langchain-ai\\/langchainjs"}],"references":[{"url":"https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee","tags":["Exploit","Third Party Advisory","web"]},{"url":"https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9","tags":["Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-7774","tags":["advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-hc5w-c9f8-9cc4"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/7xxx/CVE-2024-7774.json","tags":["advisory"]},{"url":"https://github.com/langchain-ai/langchainjs","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-7774","title":"Path Traversal in langchain-ai/langchainjs","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.","status":"published","published":"2024-10-29T12:49:21.165Z","modified":"2024-10-29T13:31:38.566Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-29"],"updated_at":"2026-11-02T14:34:20.673123Z"}],"euvd":[{"id":"EUVD-2024-0091","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.","status":"published","published":"2024-10-29T12:49:21Z","modified":"2024-10-29T13:31:38Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T00:05:15.24326Z"}],"ghsa":[{"id":"GHSA-hc5w-c9f8-9cc4","title":"Langchain Path Traversal vulnerability","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.","status":"published","published":"2024-10-29T15:32:05Z","modified":"2024-11-01T15:24:38Z","cvss":[{"version":"4.0","score":6.9,"vector":"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","level":"medium"},{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-22","CWE-29"],"updated_at":"2026-11-02T14:38:15.606692Z"}],"nvd":[{"id":"CVE-2024-7774","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.","status":"published","published":"2024-10-29T13:15:09.93Z","modified":"2026-06-17T08:20:53.75Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","level":"critical","assessor":"primary"},{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-29","CWE-22"],"updated_at":"2026-11-02T14:10:35.289159Z"}],"osv":[{"id":"CVE-2024-7774","title":"Path Traversal in langchain-ai/langchainjs","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.","status":"published","published":"2024-10-29T12:49:21.165Z","modified":"2026-10-28T02:30:32.512237129Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-29"],"updated_at":"2026-11-02T15:44:45.405014Z"},{"id":"GHSA-hc5w-c9f8-9cc4","title":"Langchain Path Traversal vulnerability","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.","status":"published","published":"2024-10-29T15:32:05Z","modified":"2026-08-07T08:12:27.358969759Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"},{"version":"4.0","score":6.9,"vector":"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","level":"medium"}],"cwes":["CWE-22","CWE-29"],"updated_at":"2026-11-02T15:46:48.920784Z"},{"id":"PYSEC-2024-111","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.","status":"withdrawn","published":"2024-10-29T13:15:00Z","modified":"2025-10-09T08:27:22.374136Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","level":"critical"}],"updated_at":"2026-11-02T15:52:53.837392Z"}]}}
