LangChainPublished 16 Apr 2024NVD status: Analyzed

CVE-2024-3571

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.

ComponentLangChain
Severityhigh (CVSS 8.8)
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Published (NVD)2024-04-16
Last modified2026-06-17
Affected versions
< 0.0.353
from the GitHub-reviewed advisory GHSA-rgp8-pm28-3759
Fixed in0.0.353
WeaknessCWE-22
CISA KEVnot listed

Versions, checked against NVD

NVD's analysis reads = 0.0.351. The ranges above come from the GitHub-reviewed advisory GHSA-rgp8-pm28-3759. The page and the scanner follow it: no more trusted source, and no two sources together, say otherwise (see the methodology).

NVD 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.

What to do

  • Upgrade LangChain to 0.0.353 or later.
  • Do not expose the component's API or UI to the internet without authentication in front of it.

Sources