LangChain versions prior to 0.2.5 have a path traversal vulnerability affecting file security.
Reporter | Title | Published | Views | Family All 9 |
---|---|---|---|---|
![]() | Langchain Path Traversal vulnerability | 29 Oct 202415:32 | – | github |
![]() | Langchain Path Traversal vulnerability | 29 Oct 202415:32 | – | osv |
![]() | CGA-pmgr-vj55-v49h | 26 Nov 202415:21 | – | osv |
![]() | PYSEC-2024-111 | 29 Oct 202413:15 | – | osv |
![]() | CVE-2024-7774 | 29 Oct 202413:15 | – | osv |
![]() | CVE-2024-7774 Path Traversal in langchain-ai/langchainjs | 29 Oct 202412:49 | – | cvelist |
![]() | CVE-2024-7774 Path Traversal in langchain-ai/langchainjs | 29 Oct 202412:49 | – | vulnrichment |
![]() | CVE-2024-7774 | 29 Oct 202413:15 | – | nvd |
![]() | CVE-2024-7774 | 29 Oct 202413:15 | – | cve |
#%NASL_MIN_LEVEL 80900
##
# Tenable, Inc.
##
include('compat.inc');
if (description)
{
script_id(213566);
script_version("1.2");
script_set_attribute(attribute:"plugin_modification_date", value:"2025/01/16");
script_cve_id("CVE-2024-7774");
script_name(english:"LangChain < 0.2.5 Arbitrary File Write");
script_set_attribute(attribute:"synopsis", value:
"The remote host is affected by a vulnerability.");
script_set_attribute(attribute:"description", value:
"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.");
# https://github.com/langchain-ai/langchainjs/commit/a0fad77d6b569e5872bd4a9d33be0c0785e538a9
script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?ea6e05bc");
script_set_attribute(attribute:"see_also", value:"https://huntr.com/bounties/8fe40685-b714-4191-af7a-3de5e5628cee");
script_set_attribute(attribute:"solution", value:
"Upgrade to LangChain version 0.2.5 or later.");
script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:N");
script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N");
script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
script_set_attribute(attribute:"cvss_score_source", value:"CVE-2024-7774");
script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
script_set_attribute(attribute:"exploit_available", value:"true");
script_cwe_id(22, 29);
script_set_attribute(attribute:"vuln_publication_date", value:"2024/10/29");
script_set_attribute(attribute:"patch_publication_date", value:"2024/10/29");
script_set_attribute(attribute:"plugin_publication_date", value:"2025/01/08");
script_set_attribute(attribute:"plugin_type", value:"local");
script_set_attribute(attribute:"cpe", value:"cpe:/a:langchain:langchain");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"Artificial Intelligence");
script_copyright(english:"This script is Copyright (C) 2025 and is owned by Tenable, Inc. or an Affiliate thereof.");
script_dependencies("python_langchain_detect.nbin");
script_require_keys("installed_sw/LangChain");
exit(0);
}
include('vcf.inc');
var app_info = vcf::get_app_info(app:'LangChain');
var constraints = [
{ 'fixed_version':'0.2.5' }
];
vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_HOLE);
Transform Your Security Services
Elevate your offerings with Vulners' advanced Vulnerability Intelligence. Contact us for a demo and discover the difference comprehensive, actionable intelligence can make in your security strategy.
Book a live demo