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.

Severity (CVSS 3.0)6.5Medium
Exploit odds (30 days)1.9%top 20.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
PyPIlangchain0.0.353GHSA-rgp8-pm28-3759
PyPIlangchain0.0.353PYSEC-2026-1510

Affected products (as reported)

VendorProductVersions
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

References