Skip to content
Fencer Vulns
medium 6.5

CVE-2024-7774 json

Path Traversal in langchain-ai/langchainjs

published 2024-10-29 2 y ago modified 2026-08-07 3 mo ago also GHSA-hc5w-c9f8-9cc4 , EUVD-2024-0091

cvss
6.5
version 3.0, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.6%
EPSS 0.6% chance of exploitation in 30 days, percentile 46%
public exploits
0
none known

Summary

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.

Patch / fix

  • npm langchain 0.2.19
  • langchain-ai langchain-ai/langchainjs 0.2.19
  • langchain-ai langchain-ai\/langchainjs 0.2.19

CISA SSVC

Exploitation
Proof of concept is public
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

0.56% chance of exploitation in the next 30 days, higher than 46% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • huntr.com https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.0 6.5 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
NVD 3.1 9.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
GitHub 3.0 6.5 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Affected packages

ecosystem package affected fixed in
npm langchain
<0.2.19
0.2.19

Affected products

  • langchain-ai langchain-ai/langchainjs
  • langchain-ai langchain-ai\/langchainjs

Classification

Weakness
  • CWE-29 Path Traversal: '\..\filename'
  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.