Browse / Improper Output Handling / CVE-2023-38896
LangChain vulnerable to arbitrary code execution
- Class
- Improper Output Handling (filed by a model that read the advisory)
- Technique
- Code and command execution
- Also involves
- Direct Prompt Injection
- Affected
- langchain (PyPI)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS
- 1.8% chance of exploitation in 30 days
How it works, in short
Crafted input to helper chains makes the model generate Python that the chain runs without adequate checks, letting a remote party execute arbitrary code. (Our summary, written by a model. The source text is below.)
Details
An issue in Harrison Chase langchain before version 0.0.236 allows a remote attacker to execute arbitrary code via the from_math_prompt and from_colored_object_prompt functions.
References
- https://nvd.nist.gov/vuln/detail/CVE-2023-38896
- https://github.com/hwchase17/langchain/issues/5872
- https://github.com/hwchase17/langchain/pull/6003
- https://github.com/langchain-ai/langchain/commit/8ba9835b925473655914f63822775679e03ea137
- https://github.com/langchain-ai/langchain/commit/e294ba475a355feb95003ed8f1a2b99942509a9e
- https://github.com/langchain-ai/langchain
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-146.yaml
- https://twitter.com/llm_sec/status/1668711587287375876
Source: GitHub Advisory Database, used under CC BY 4.0.