CVE-2024-7774Langchain.js
Critical 9.1 No auth needed
Follow: this CVE · Langchain · Langchain.js We alert you by email or Slack (account required).
- Priority
- 70
- CVSS 3.1
- 9.1
- EPSS
- 0.7% probability of exploitation in 30 days · percentile 51
- Auth required
- No
- Published
- Oct 29, 2024
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
What happens
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.
What to do
- Apply the vendor's security update for Langchain.js.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | langchain |
< 0.2.19 |
0.2.19 |
npm install langchain@0.2.19 |
Per OSV / GitHub Advisories (GHSA-hc5w-c9f8-9cc4). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| langchain | langchain.js | 0.2.5 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- huntr.com Exploit Third Party Advisory