Vulnerability · Published Apr 16, 2024 · Assigned by @huntr_ai
CVE-2024-3571Path Traversal in langchain-ai/langchain
Medium 6.5
In plain English
A medium-severity path traversal in langchain-ai/langchain from langchain-ai. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 79% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
langchain-ai/langchain is vulnerable to path traversal due to improper limitation of a pathname to a restricted directory ('Path Traversal') in its LocalFileStore functionality. An attacker can leverage this vulnerability to read or write files anywhere on the filesystem, potentially leading to information disclosure or remote code execution. The issue lies in the handling of file paths in the mset and mget methods, where user-supplied input is not adequately sanitized, allowing directory traversal sequences to reach unintended directories.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | langchain | 0.0.353 | GHSA-rgp8-pm28-3759 |
| PyPI | langchain | 0.0.353 | PYSEC-2026-1510 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| langchain-ai | langchain-ai/langchain | unspecified – before 0.0.353 |
Weakness: CWE-22 · Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N