Browse / AI Framework and Platform Flaws / CVE-2024-7774
Langchain Path Traversal vulnerability
- Class
- AI Framework and Platform Flaws (filed by a model that read the advisory)
- Technique
- Path traversal and file access
- Affected
- langchain (npm)
- CVSS
- CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- EPSS
- 0.6% chance of exploitation in 30 days
How it works, in short
A path helper does not sanitise user input, letting callers write, overwrite, read and delete files outside the intended directory. (Our summary, written by a model. The source text is below.)
Details
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.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-7774
- https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9
- https://github.com/langchain-ai/langchainjs
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml
- https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee
Source: GitHub Advisory Database, used under CC BY 4.0.