CVE-2023-29374
CRITICAL 9.8CVSS 3.1LangChain vulnerable to code injection
In LangChain through 0.0.131, the LLMMathChain chain allows prompt injection attacks that can execute arbitrary code via the Python exec method.
- Published
- 5 Apr 2023
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-74CWE-94
- Also known as
- GHSA-fprp-p869-w6q2PYSEC-2023-18
- Sources
- NVDJSONOSV GHSA-fprp-p869-w6q2JSONOSV PYSEC-2023-18JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | langchain | langchaincpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* |
<= 0.0.131 | |
| OSV | PyPI | langchain | <= 0.0.131 | |
| OSV | PyPI | langchain | < 0.0.132 | 0.0.132 |
References
- https://github.com/hwchase17/langchain/issues/1026 · Issue Tracking, WEB, REPORT
- https://github.com/hwchase17/langchain/issues/814 · Exploit, Issue Tracking, Patch, WEB, REPORT
- https://github.com/hwchase17/langchain/pull/1119 · Patch, WEB
- https://twitter.com/rharang/status/1641899743608463365/photo/1 · Exploit, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-29374 · ADVISORY
- https://github.com/langchain-ai/langchain · PACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-18.yaml · WEB
- https://github.com/advisories/GHSA-fprp-p869-w6q2 · ADVISORY
History
- 25 Nov 2026 20:36 UTC · NVD: first stored (published 5 Apr 2023)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 5 Apr 2023)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 5 Apr 2023)