CVE-2024-5998: Langchain community LangChain Pickle Deserialization Of Untrusted Vulnerability
HIGHCVE-2024-5998 is a HIGH (CVSS 5.2) langchain pickle deserialization of untrusted vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Langchain community libraries in the PyPI ecosystem. The issue involves langchain pickle deserialization of untrusted data. Remediation is available by upgrading affected packages to version 0.2.4.
CVE-2024-5998 at a Glance
Security Impact
CVSS: 5.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:P/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L).
How to Fix CVE-2024-5998
To remediate this vulnerability, upgrade all affected Langchain community dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install langchain-community>=0.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show langchain-community
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-5998, inspect your installed packages using pip:
pip show langchain-community
Analyze the terminal output to locate any version of Langchain community in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.4), your application is affected.
Note: The pip show langchain-community command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Langchain community, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-5998 Affected Langchain community Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
langchain-community
|
PyPI |
< 0.2.4
|
0.2.4
|
References
Frequently Asked Questions
What is CVE-2024-5998?
Which Langchain community versions are affected?
What version fixes CVE-2024-5998?
Is langchain-community affected?
What is the CVSS score of CVE-2024-5998?
What CWE is associated with CVE-2024-5998?
How can I check PyPI dependencies for CVE-2024-5998?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f2jm-rw3h-6phg",
"modified" : "2025-07-30T19:30:02Z",
"published" : "2024-09-17T12:30:32Z",
"aliases" : [ "CVE-2024-5998" ],
"summary" : "LangChain pickle deserialization of untrusted data",
"details" : "A vulnerability in the `FAISS.deserialize_from_bytes` function of langchain-ai/langchain allows for pickle deserialization of untrusted data. This can lead to the execution of arbitrary commands via the `os.system` function. The issue affects versions prior to 0.2.4.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:P/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "langchain-community"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-5998"
}, {
"type" : "WEB",
"url" : "https://github.com/langchain-ai/langchain/commit/604dfe2d99246b0c09f047c604f0c63eafba31e7"
}, {
"type" : "WEB",
"url" : "https://github.com/langchain-ai/langchain/commit/77209f315efd13442ec51c67719ba37dfaa44511"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/langchain-ai/langchain"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/fa3a2753-57c3-4e08-a176-d7a3ffda28fe"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-17T21:23:31Z",
"nvd_published_at" : "2024-09-17T12:15:02Z"
}
}