CVE-2024-38459: Langchain experimental Langchain_experimental Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-wmvm-9vqv-5qpp
CVSS 7.8
CWE-276
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-38459
GHSA Identifier GHSA-wmvm-9vqv-5qpp
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product Langchain experimental
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

langchain-experimental fixed: 0.0.61
pip install langchain-experimental>=0.0.61
Verify Direct and Transitive Dependencies

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

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.

CVE-2024-38459 Affected Langchain experimental Versions

1 component(s)
Fixed Versions:
0.0.61
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?
CVE-2024-38459 is a security vulnerability in Langchain experimental involving langchain_experimental Code Execution via Python REPL access under CWE-276: Incorrect Default Permissions.
Which Langchain experimental versions are affected?
Affected versions include releases prior to 0.0.61 across affected packages: langchain-experimental.
What version fixes CVE-2024-38459?
Upgrading to 0.0.61 (or the latest patched release for your respective branch) resolves the vulnerability.
Is langchain-experimental affected?
Yes, langchain-experimental is affected in releases prior to 0.0.61. Upgrade your dependency to 0.0.61 or later.
What is the CVSS score of CVE-2024-38459?
CVE-2024-38459 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-38459?
CVE-2024-38459 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check PyPI dependencies for CVE-2024-38459?
Run the dependency tree command: 'pip show langchain-experimental'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}