CVE-2024-7774
Langchain Path Traversal vulnerability
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (medium).
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.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| echo npm::Echo OSV | langchain | 0.2.19 |
| npm::GitHub Security Advisory npm | langchain | 0.2.19 |
| seal pip::Seal Security Database | langchain, seal-langchain | 0.0.279+sp999, 0.0.281+sp999, 0.0.287+sp999, 0.0.288+sp999, 0.0.289+sp999, 0.0.290+sp999, 0.0.297+sp999, 0.0.298+sp999, 0.0.299+sp999, 0.0.300+sp999, 0.0.301+sp999, 0.0.302+sp999, 0.0.303+sp999 |
Show all 4 entries from 3 sources
| Source | Package | Fixed in |
|---|---|---|
| echo npm::Echo OSV | langchain | 0.2.19 |
| npm::GitHub Security Advisory npm | langchain | 0.2.19 |
| seal pip::Seal Security Database | langchain | 0.0.279+sp999, 0.0.281+sp999, 0.0.287+sp999, 0.0.288+sp999, 0.0.289+sp999, 0.0.290+sp999, 0.0.297+sp999, 0.0.298+sp999, 0.0.299+sp999, 0.0.300+sp999, 0.0.301+sp999, 0.0.302+sp999, 0.0.303+sp999 |
| seal pip::Seal Security Database | seal-langchain | 0.0.279+sp999, 0.0.281+sp999, 0.0.287+sp999, 0.0.288+sp999, 0.0.289+sp999, 0.0.290+sp999, 0.0.297+sp999, 0.0.298+sp999, 0.0.299+sp999, 0.0.300+sp999, 0.0.301+sp999, 0.0.302+sp999, 0.0.303+sp999 |
References
- https://advisory.echohq.com/cve/CVE-2024-7774
- https://github.com/advisories/GHSA-hc5w-c9f8-9cc4
- https://github.com/langchain-ai/langchainjs
- https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-111.yaml
- https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee
- https://nvd.nist.gov/vuln/detail/CVE-2024-7774