CVE-2024-7774

Path Traversal in langchain-ai/langchainjs

State
Published
Severity
6.5 Medium
Published
Oct 29, 2024
Updated
Oct 29, 2024
Reserved
Aug 13, 2024

Read the record on cve.org

Description

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.

Scores

CVSSScoreVectorSource
3.06.5 MediumCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N@huntr_ai

Weaknesses

  • CWE-29 Path Traversal: '\..\filename'

Affected Products

ProductVersions
langchain-ai/langchainjslangchain-ai
  • before 0.2.19Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.