CVE-2023-36281 json
langchain vulnerable to arbitrary code execution
published 2023-08-22 3 y ago modified 2026-06-17 4 mo ago also GHSA-7gfq-f96f-g85j , PYSEC-2023-151 , EUVD-2023-0116
- cvss
- 9.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 3.4%
- EPSS 3.4% chance of exploitation in 30 days, percentile 88%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi langchain 0.0.171, 0.0.312
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
3.41% chance of exploitation in the next 30 days, higher than 88% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/hwchase17/langchain/issues/4394 referenced PoC, tagged "exploit" by a source, unverified
- aisec.today https://aisec.today/LangChain-2e6244a313dd46139c5ef28cbcab9e55 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CISA ADP | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | langchain | <0.0.312 <0.0.171 |
0.0.312 0.0.171 |
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/langchain-ai/langchain/pull/10252
web
-
github.com
/langchain-ai/langchain/commit/22abeb9f6cc555591bf8e92b5e328e43aa07ff6c
web
-
github.com
/hwchase17/langchain/issues/4394
web, exploit, issue-tracking, vendor-advisory, evidence, report, advisory
-
aisec.today
/LangChain-2e6244a313dd46139c5ef28cbcab9e55
web, exploit, third-party-advisory, evidence
-
github.com
/langchain-ai/langchain/releases/tag/v0.0.312
web
-
nvd.nist.gov
/vuln/detail/CVE-2023-36281
advisory
-
github.com
/langchain-ai/langchain
package
-
github.com
/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-151.yaml
web
-
github.com
/advisories/GHSA-7gfq-f96f-g85j
advisory
Sources
- CVE List CVE-2023-36281
- GitHub Advisory GHSA-7gfq-f96f-g85j
- NVD CVE-2023-36281
- OSV PYSEC-2023-151
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.