CVE-2024-7774
Path Traversal in langchain-ai/langchainjs
Reported by @huntr_ai · Published October 29, 2024
langchain is fixed in 0.2.19 (npm)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| langchain | npm | 0.2.19 |
| kibana-8 | Chainguard | 8.16.1-r1 |
| langchain-ai\/langchainjs | langchain-ai | 0.2.19 |
| langchain-ai/langchainjs | langchain-ai | 0.2.19 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| langchain-ai | langchain-ai/langchainjs | unspecified |
| langchain-ai | langchain-ai\/langchainjs | 0 |
| langchain-ai | langchain-ai/langchainjs | * |
| PyPI | langchain | 0 |
| chainguard | kibana-8 | 0 |
| npm | langchain | 0 |
Timeline
- Oct 29, 2024 CVE Published
- Oct 29, 2024 Coalition ESS Score (9 in total, the first dated here)
- Oct 29, 2024 CVE Updated
- Oct 29, 2024 PoC Published
- Oct 30, 2024 EPSS Score (30 in total, the first dated here)
- Mar 9, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-7774
vulnetix vdb fixes CVE-2024-7774
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-7774/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart