{"id":"CVE-2023-39631","aliases":["CVE-2023-39631","GHSA-f73w-4m7g-ch9x","PYSEC-2023-162","PYSEC-2023-163"],"related":[],"kind":"vulnerability","state":"published","title":"Langchain vulnerable to arbitrary code execution via the evaluate function in the numexpr library","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.\n\nPatches: Released in v.0.0.308. numexpr dependency is optional for langchain.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Un problema en  LanChain-ai Langchain v.0.0.245 permite a un atacante remoto ejecutar código arbitrario a través de la función evaluate en numexpr library.","source":"nvd"}],"published":"2023-09-01T00:00:00.000Z","modified":"2026-06-17T06:12:38.260Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.308"}],"ecosystem":"PyPI","package":"langchain","purl":"pkg:pypi/langchain","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.5"}],"ecosystem":"PyPI","package":"numexpr","purl":"pkg:pypi/numexpr","source":"ghsa"},{"ranges":[{"status":"affected","version":"0.0.245"}],"vendor":"langchain","product":"langchain","cpe":"cpe:2.3:a:langchain:langchain:0.0.245:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.308"}],"ecosystem":"PyPI","package":"langchain","purl":"pkg:pypi/langchain","source":"pysec"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.8.5"}],"ecosystem":"PyPI","package":"numexpr","purl":"pkg:pypi/numexpr","source":"pysec"}],"references":[{"url":"https://github.com/langchain-ai/langchain/issues/8363","tags":["evidence","exploit","fix","issue-tracking","patch","report","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydata/numexpr/issues/442","tags":["evidence","exploit","fix","issue-tracking","patch","report","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39631","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/langchain-ai/langchain/pull/11302","tags":["fix","web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pydata/numexpr/commit/4b2d89cf14e75030d27629925b9998e1e91d23c7","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/langchain-ai/langchain","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/langchain-ai/langchain/releases/tag/v0.0.308","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-162.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/numexpr/PYSEC-2023-163.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-f73w-4m7g-ch9x","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2024-10-01T13:18:27.452Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-39631","url":"https://www.cve.org/CVERecord?id=CVE-2023-39631","licence":"CVE Terms of Use","modified":"2024-10-01T13:18:38.891Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f73w-4m7g-ch9x","url":"https://github.com/advisories/GHSA-f73w-4m7g-ch9x","licence":"CC-BY-4.0","modified":"2025-02-20T23:01:00.348Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-39631","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39631","licence":"Public domain","modified":"2026-06-17T06:12:38.260Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2023-162","url":"https://osv.dev/vulnerability/PYSEC-2023-162","licence":"CC-BY-4.0","modified":"2023-11-08T04:13:15.129Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2023-163","url":"https://osv.dev/vulnerability/PYSEC-2023-163","licence":"CC-BY-4.0","modified":"2026-06-10T17:02:26.302Z"}],"updatedAt":"2026-11-25T22:58:27.514Z","epss":{"score":0.016,"percentile":0.76501,"date":"2026-12-01T12:00:22.000Z"}}