LangChain < 0.2.5 Arbitrary File Write

critical Nessus Plugin ID 213566

Synopsis

The remote host is affected by a vulnerability.

Description

The version of LangChain installed on the remote host is prior to 0.2.5. It is, therefore, affected by a path traversal vulnerability which exists in the `getFullPath` method. 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.

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

Solution

Upgrade to LangChain version 0.2.5 or later.

See Also

https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee

http://www.nessus.org/u?ea6e05bc

Plugin Details

Severity: Critical

ID: 213566

File Name: langchain_CVE-2024-7774.nasl

Version: 1.1

Type: local

Published: 1/8/2025

Updated: 1/8/2025

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.0

CVSS v2

Risk Factor: High

Base Score: 9.4

Vector: CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:N

CVSS Score Source: CVE-2024-7774

CVSS v3

Risk Factor: Critical

Base Score: 9.1

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Vulnerability Information

CPE: cpe:/a:langchain:langchain

Required KB Items: installed_sw/LangChain

Patch Publication Date: 10/29/2024

Vulnerability Publication Date: 10/29/2024

Reference Information

CVE: CVE-2024-7774