CVE-2024-38459: Langchain experimental Langchain_experimental Code Execution Vulnerability
HIGHCVE-2024-38459 is a HIGH (CVSS 7.8) langchain_experimental code execution vulnerability (CWE-276: Incorrect Default Permissions) affecting Langchain experimental libraries in the PyPI ecosystem. The issue involves langchain_experimental code execution via python repl access. Remediation is available by upgrading affected packages to version 0.0.61.
CVE-2024-38459 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-38459
To remediate this vulnerability, upgrade all affected Langchain experimental 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-experimental>=0.0.61
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show langchain-experimental
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-38459, inspect your installed packages using pip:
pip show langchain-experimental
Analyze the terminal output to locate any version of Langchain experimental in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.61), your application is affected.
Note: The pip show langchain-experimental command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Langchain experimental, 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-38459 Affected Langchain experimental Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
langchain-experimental
|
PyPI |
< 0.0.61
|
0.0.61
|
References
Frequently Asked Questions
What is CVE-2024-38459?
Which Langchain experimental versions are affected?
What version fixes CVE-2024-38459?
Is langchain-experimental affected?
What is the CVSS score of CVE-2024-38459?
What CWE is associated with CVE-2024-38459?
How can I check PyPI dependencies for CVE-2024-38459?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wmvm-9vqv-5qpp",
"modified" : "2024-07-05T21:18:35Z",
"published" : "2024-06-16T15:30:44Z",
"aliases" : [ "CVE-2024-38459" ],
"summary" : "langchain_experimental Code Execution via Python REPL access",
"details" : "langchain_experimental (aka LangChain Experimental) before 0.0.61 for LangChain provides Python REPL access without an opt-in step. NOTE; this issue exists because of an incomplete fix for CVE-2024-27444.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "langchain-experimental"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.61"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38459"
}, {
"type" : "WEB",
"url" : "https://github.com/langchain-ai/langchain/pull/22860"
}, {
"type" : "WEB",
"url" : "https://github.com/langchain-ai/langchain/commit/ce0b0f22a175139df8f41cdcfb4d2af411112009"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/langchain-ai/langchain"
}, {
"type" : "WEB",
"url" : "https://github.com/langchain-ai/langchain/compare/langchain-experimental==0.0.60...langchain-experimental==0.0.61"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/langchain-experimental/PYSEC-2024-53.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-276" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-17T21:21:47Z",
"nvd_published_at" : "2024-06-16T15:15:51Z"
}
}