# CVE-2023-39659: LangChain vulnerable to arbitrary code execution

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.52%, higher than 75% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2023-08-15T00:00:00.000Z
- Modified: 2026-06-17T06:12:40.930Z
- Also known as: GHSA-prgp-w7vf-ch62, PYSEC-2023-147
- Weaknesses: CWE-74
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: mitre

## Description

An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to execute arbitrary code via a crafted script to the PythonAstREPLTool._run component.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- langchain (PyPI): before 0.0.325; before 0.0.233
- langchain langchain: up to 0.0.232

## Every score

- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:4.0 Critical `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: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/langchain-ai/langchain/issues/7700> (exploit, evidence, issue-tracking, report, third-party-advisory, web)
- <https://github.com/langchain-ai/langchain/pull/5640> (fix, issue-tracking, patch, report, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-39659> (advisory)
- <https://github.com/langchain-ai/langchain/pull/12427> (web)
- <https://github.com/langchain-ai/langchain/commit/cadfce295f8a33828fc635c2e5ea28b883e5c992> (web)
- <https://github.com/langchain-ai/langchain> (package)
- <https://github.com/langchain-ai/langchain/releases/tag/v0.0.325> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-147.yaml> (web)
- <https://github.com/advisories/GHSA-prgp-w7vf-ch62> (advisory)

## Sources

- CVE List: [CVE-2023-39659](https://www.cve.org/CVERecord?id=CVE-2023-39659), CVE Terms of Use, modified 2024-10-08
- GitHub Advisory Database: [GHSA-prgp-w7vf-ch62](https://github.com/advisories/GHSA-prgp-w7vf-ch62), CC-BY-4.0, modified 2024-09-27
- NVD: [CVE-2023-39659](https://nvd.nist.gov/vuln/detail/CVE-2023-39659), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2023-147](https://osv.dev/vulnerability/PYSEC-2023-147), CC-BY-4.0, modified 2026-06-10

---

Page: https://cve.day/CVE-2023-39659 · Whole record: https://cve.day/CVE-2023-39659.json · Rebuilt by cve.day 2026-11-25T22:58:27.141Z
