| Component | LangChain (LangChain.js) |
| Severity | critical (CVSS 9.1) |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| Published (NVD) | 2024-10-29 |
| Last modified | 2026-06-17 |
| Affected versions | < 0.2.19 from the GitHub-reviewed advisory GHSA-hc5w-c9f8-9cc4 |
| Fixed in | 0.2.19 |
| Weakness | CWE-29CWE-22 |
| CISA KEV | not listed |
Versions, checked against NVD
NVD's analysis reads = 0.2.5. The ranges above come from the GitHub-reviewed advisory GHSA-hc5w-c9f8-9cc4. The page and the scanner follow it: no more trusted source, and no two sources together, say otherwise (see the methodology).
NVD 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.
What to do
- Upgrade LangChain to
0.2.19or later. - Do not expose the component's API or UI to the internet without authentication in front of it.