Path Traversal in langchain-ai/langchainjs
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| langchain-ai | langchain-ai/langchainjs | before 0.2.19 | 0.2.19 | Patch available | CNA |
| — | langchain (npm) | before 0.2.19 | 0.2.19 | Patch available | GHSA-hc5w-c9f8-9cc4 |
- langchain-ai/langchainjs Vendorlangchain-ai Affected before 0.2.19 Fixed in 0.2.19 Patch available CNA
- langchain (npm) Vendor— Affected before 0.2.19 Fixed in 0.2.19 Patch available GHSA-hc5w-c9f8-9cc4
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:langchain:langchain.js:0.2.5:*:*:*:*:*:*:* | 0.2.5 | Vulnerable | langchain-ai |
- cpe:2.3:a:langchain:langchain.js:0.2.5:*:*:*:*:*:*:* Versions 0.2.5 Vulnerable ·langchain-ai
Remediation
- Fix · CNA langchain-ai/langchainjs (langchain-ai) Fixed in 0.2.19
- Fix · GHSA-hc5w-c9f8-9cc4 langchain (npm) Fixed in 0.2.19 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-7774
- 2026-10-03 Alias added: GHSA-hc5w-c9f8-9cc4
References
More langchain-ai Langchain.js vulnerabilities
- TI-2025-42158 LangChain serialization injection vulnerability enables secret extraction CVSS 3.1CRITICAL 9.1
Sources
- CVE-2024-7774 · CVE Program
- CVE-2024-7774 · NVD
- FIRST EPSS
- GHSA-hc5w-c9f8-9cc4 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences