CVE-2024-7774: langchain-ai langchain-ai/langchainjs Path Traversal: '\..\filename'
Vulnerability summary
CVE-2024-7774 is a critical (CVSS 9.1) Path Traversal: '\..\filename' vulnerability in langchain-ai langchain-ai/langchainjs. EPSS estimates a 0.56% chance of exploitation in the next 30 days, higher than 45.3% of scored vulnerabilities. 1 public exploit is recorded.
Advisory lineage
Upstream 0 · Downstream 0 · Related 2Timeline
- 29-10-2024PublishedVulnerability first disclosed.
- 29-10-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
5 scores · 3 sources · 3 versions- OSV · NpmEcosystem advisory · calculated6.5MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- NVDNIST6.5MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
EPSS trend
Probability
0.56%
Chance of exploitation in the next 30 days
Percentile
45%
Versus all other CVEs
30-day change
+0.01 pp
From 0.55% on 19-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundExploit Reference (huntr.com)
Maturity: unknown
Weaknesses
CWE · root cause- CWE-29Path Traversal: '\..\filename'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.
- CWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')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.
Affected systems
Langchain1 product
- langchain.js0.2.5
Langchain-ai1 product
- langchain-ai/langchainjs≥ unspecified, < 0.2.19
Npm1 product
- langchain< 0.2.19
3 vendors · 3 products