{"id":"CVE-2023-39659","aliases":["CVE-2023-39659","GHSA-prgp-w7vf-ch62","PYSEC-2023-147"],"related":[],"kind":"vulnerability","state":"published","title":"LangChain vulnerable to arbitrary code execution","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"An issue in langchain langchain-ai before version 0.0.325 allows a remote attacker to execute arbitrary code via a crafted script to the PythonAstREPLTool._run component.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Un problema en langchain langchain-ai v.0.0.232 y anteriores permite a un atacante remoto ejecutar código arbitrario a través de un script manipulado en el componente PythonAstREPLTool._run.","source":"nvd"}],"published":"2023-08-15T00:00:00.000Z","modified":"2026-06-17T06:12:40.930Z","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":"GitHub","scheme":"CVSS:4.0","vector":"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","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-74"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.325"}],"ecosystem":"PyPI","package":"langchain","purl":"pkg:pypi/langchain","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"0.0.232"}],"vendor":"langchain","product":"langchain","cpe":"cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.233"}],"ecosystem":"PyPI","package":"langchain","purl":"pkg:pypi/langchain","source":"pysec"}],"references":[{"url":"https://github.com/langchain-ai/langchain/issues/7700","tags":["evidence","exploit","issue-tracking","report","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/langchain-ai/langchain/pull/5640","tags":["fix","issue-tracking","patch","report","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39659","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/langchain-ai/langchain/pull/12427","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/langchain-ai/langchain/commit/cadfce295f8a33828fc635c2e5ea28b883e5c992","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.325","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-147.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-prgp-w7vf-ch62","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2024-10-08T20:27:51.396Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-39659","url":"https://www.cve.org/CVERecord?id=CVE-2023-39659","licence":"CVE Terms of Use","modified":"2024-10-08T20:28:08.726Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-prgp-w7vf-ch62","url":"https://github.com/advisories/GHSA-prgp-w7vf-ch62","licence":"CC-BY-4.0","modified":"2024-09-27T21:33:25.955Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-39659","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-39659","licence":"Public domain","modified":"2026-06-17T06:12:40.930Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2023-147","url":"https://osv.dev/vulnerability/PYSEC-2023-147","licence":"CC-BY-4.0","modified":"2026-06-10T17:02:00.020Z"}],"updatedAt":"2026-11-25T22:58:27.141Z","epss":{"score":0.01521,"percentile":0.75336,"date":"2026-12-01T12:00:22.000Z"}}