{"id":"CVE-2023-36281","published":"2023-08-22T00:00:00Z","modified":"2024-10-15T16:39:03Z","title":"An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a JSON file to load_prompt","vendor":null,"product":null,"tier":"tail","description":{"text":"An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a JSON file to load_prompt. This is related to __subclasses__ or a template.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.03412,"percentile":0.89176,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/hwchase17/langchain/issues/4394","tags":[]},{"url":"https://aisec.today/LangChain-2e6244a313dd46139c5ef28cbcab9e55","tags":[]},{"url":"https://github.com/langchain-ai/langchain/releases/tag/v0.0.312","tags":[]}],"priority":{"score":29.7,"factors":[{"name":"EPSS percentile","points":17.84},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.86}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2023-08-31","earliestUrl":"https://github.com/tagomaru/CVE-2023-36281","repos":[{"name":"tagomaru/CVE-2023-36281","url":"https://github.com/tagomaru/CVE-2023-36281","stars":2,"created":"2023-08-31"}]},"first":{"date":"2023-08-31","source":"PoC-in-GitHub","url":"https://github.com/tagomaru/CVE-2023-36281"},"provenance":"source"},"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2023-12-13T16:27:50.227615Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"langchain","vulnerableRanges":["<0.0.312","<0.0.171"],"patched":["0.0.312","0.0.171"],"from":["GHSA-7gfq-f96f-g85j","PYSEC-2023-151"],"provenance":"source"}],"summary":{"text":"The flaw is in the load_prompt function of langchain version 0.0.171, where a crafted JSON file can cause the loader to execute arbitrary code, reportedly related to __subclasses__ or template handling. An attacker who can get a malicious JSON file processed by load_prompt can run arbitrary code remotely, with no authentication or user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T04:02:36Z"},"euvd":{"id":"EUVD-2023-0116","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-29374","published":"2023-04-05","fixed":"0.0.132","kev":false,"link":{"from":"CVE-2023-29374","to":"CVE-2023-36281","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:langchain","fromFixed":"0.0.132","toFixed":"0.0.171","daysApart":139}]}},{"cve":"CVE-2023-38896","published":"2023-08-15","fixed":"0.0.236","kev":false,"link":{"from":"CVE-2023-36281","to":"CVE-2023-38896","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:langchain","fromFixed":"0.0.171","toFixed":"0.0.195","daysApart":-7}]}},{"cve":"CVE-2023-36258","published":"2023-07-03","fixed":"0.0.247","kev":false},{"cve":"CVE-2023-38860","published":"2023-08-15","fixed":"0.0.247","kev":false},{"cve":"CVE-2023-39631","published":"2023-09-01","fixed":"0.0.308","kev":false},{"cve":"CVE-2023-36281","published":"2023-08-22","fixed":"0.0.312","kev":false},{"cve":"CVE-2023-46229","published":"2023-10-19","fixed":"0.0.317","kev":false,"link":{"from":"CVE-2023-36281","to":"CVE-2023-46229","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:langchain","fromFixed":"0.0.312","toFixed":"0.0.317","daysApart":58}]}},{"cve":"CVE-2023-39659","published":"2023-08-15","fixed":"0.0.325","kev":false},{"cve":"CVE-2023-32786","published":"2023-10-20","fixed":"0.0.329","kev":false}],"package":"PyPI:langchain"}}