# CVE-2023-39631: Langchain vulnerable to arbitrary code execution via the evaluate function in the numexpr library

- 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.60%, higher than 76% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2023-09-01T00:00:00.000Z
- Modified: 2026-06-17T06:12:38.260Z
- Also known as: GHSA-f73w-4m7g-ch9x, PYSEC-2023-162, PYSEC-2023-163
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total
- Assigned by: mitre

## Description

An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary code via the evaluate function in the numexpr library.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- langchain (PyPI): before 0.0.308
- numexpr (PyPI): before 2.8.5
- langchain langchain: 0.0.245

## 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`
- 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/8363> (exploit, evidence, fix, issue-tracking, patch, report, third-party-advisory, web)
- <https://github.com/pydata/numexpr/issues/442> (exploit, evidence, fix, issue-tracking, patch, report, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2023-39631> (advisory)
- <https://github.com/langchain-ai/langchain/pull/11302> (fix, web)
- <https://github.com/pydata/numexpr/commit/4b2d89cf14e75030d27629925b9998e1e91d23c7> (web)
- <https://github.com/langchain-ai/langchain> (package)
- <https://github.com/langchain-ai/langchain/releases/tag/v0.0.308> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-162.yaml> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/numexpr/PYSEC-2023-163.yaml> (web)
- <https://github.com/advisories/GHSA-f73w-4m7g-ch9x> (advisory)

## Sources

- CVE List: [CVE-2023-39631](https://www.cve.org/CVERecord?id=CVE-2023-39631), CVE Terms of Use, modified 2024-10-01
- GitHub Advisory Database: [GHSA-f73w-4m7g-ch9x](https://github.com/advisories/GHSA-f73w-4m7g-ch9x), CC-BY-4.0, modified 2025-02-20
- NVD: [CVE-2023-39631](https://nvd.nist.gov/vuln/detail/CVE-2023-39631), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2023-162](https://osv.dev/vulnerability/PYSEC-2023-162), CC-BY-4.0, modified 2023-11-08
- PyPA Advisory Database: [PYSEC-2023-163](https://osv.dev/vulnerability/PYSEC-2023-163), CC-BY-4.0, modified 2026-06-10

---

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