Medium

Langchain Path Traversal vulnerability

  • Disclosed: 29.10.2024
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package langchain < 0.2.19 0.2.19

References

CVSS score 6.5/10
CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Weakness (CWE)
CWE-22, CWE-29
Platform
npm
Package
langchain
Disclosed
29.10.2024
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-hc5w-c9f8-9cc4 - CC BY 4.0

Vulnerability history: langchain

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
2
First → latest
10.2024 12.2025
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 1

Disclosures per year

  1. 2024: 1
  2. 2025: 1
  3. 2026: 0
  1. High · 8.6 CVE-2025-68665 >= 1.0.0, < 1.2.3, < 0.3.37 1.2.3, 0.3.37
  2. Langchain Path Traversal vulnerability this entry
    Medium · 6.5 CVE-2024-7774 < 0.2.19 0.2.19

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.