{"schemaVersion":3,"id":"CVE-2024-7774","aliases":["GHSA-hc5w-c9f8-9cc4"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2024-10-29T12:49:21.165Z","modified":"2024-10-29T13:31:38.566Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.1,"severity":"critical","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.0","versionLabel":"v3.0","source":"CVE.org","score":6.5,"severity":"medium","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"4.0","versionLabel":"v4.0","source":"OSV · Npm","score":6.9,"severity":"medium","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","exploitability":null,"impact":null,"computed":true},{"version":"3.0","versionLabel":"v3.0","source":"OSV · Npm","score":6.5,"severity":"medium","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","exploitability":10,"impact":4.2,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":9.1,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.0","versionLabel":"v3.0","source":"NVD","score":6.5,"severity":"medium","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00557,"percentile":0.45317,"severity":"low","asOf":"2026-10-19T00:00:00.000Z","change":{"pp":0.0050000000000000565,"baselineDate":"2026-09-19T00:00:00.000Z","baselineScore":0.00552},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00557,"percentile":0.45317}],"last30":[{"date":"2026-09-19T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00552,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00557,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00557,"percentile":0.45317}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_698D31905D71765B","name":"Exploit Reference (huntr.com)","source":"reference","url":"https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-29","name":"Path Traversal: '\\..\\filename'","description":"The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\\..\\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","type":"weakness","status":"Incomplete","abstraction":"Variant","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/29.html"},{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')","description":"The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/22.html"}],"affected":[{"vendor":"langchain-ai","product":"langchain-ai/langchainjs","name":"langchain-ai/langchainjs","label":"langchain-ai/langchainjs","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ unspecified, < 0.2.19","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ unspecified, < 0.2.19","eol":null,"hubHref":"/vendor/langchain-ai/langchain-ailangchainjs"},{"vendor":"langchain","product":"langchain.js","name":"langchain.js","label":"langchain.js","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"0.2.5","noFixRecorded":false,"fixedIn":null}],"versionsText":"0.2.5","eol":null,"hubHref":"/vendor/langchain/langchainjs"},{"vendor":"Npm","product":"langchain","name":"langchain","label":"langchain","ecosystem":"Npm","cpePart":null,"purl":"pkg:npm/langchain","purlType":"npm","versions":[{"text":"< 0.2.19","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 0.2.19","eol":null,"hubHref":null}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee","label":"huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee","hostname":"huntr.com","tags":["WEB","Exploit","Third Party Advisory"]},{"url":"https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9","label":"github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9","hostname":"github.com","tags":["WEB","Patch"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-7774","label":"nvd.nist.gov/vuln/detail/CVE-2024-7774","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/langchain-ai/langchainjs","label":"github.com/langchain-ai/langchainjs","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml","label":"github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml","hostname":"github.com","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":["CGA-3J5C-22JX-W4G3","CGA-PMGR-VJ55-V49H"]},"timeline":[{"kind":"published","date":"2024-10-29T12:49:21.165Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-10-29T13:31:38.566Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T04:02:45.812Z","stale":false,"partial":false}}