Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. langchain
  4. ›
  5. CVE-2023-29374

CVE-2023-29374: LangChain vulnerable to code injection

April 5, 2023 (updated February 12, 2025)

In LangChain through 0.0.131, the LLMMathChain chain allows prompt injection attacks that can execute arbitrary code via the Python exec() method.

References

  • github.com/advisories/GHSA-fprp-p869-w6q2
  • github.com/hwchase17/langchain/issues/1026
  • github.com/hwchase17/langchain/issues/814
  • github.com/hwchase17/langchain/pull/1119
  • github.com/langchain-ai/langchain
  • github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-18.yaml
  • nvd.nist.gov/vuln/detail/CVE-2023-29374
  • twitter.com/rharang/status/1641899743608463365/photo/1

Code Behaviors & Features

Detect and mitigate CVE-2023-29374 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 0.0.131

Solution

Unfortunately, there is no solution available yet.

Impact 9.8 CRITICAL

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

Learn more about CVSS

Weakness

  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/langchain/CVE-2023-29374.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:23 +0000.