Browse / Tool and Agent Misuse / CVE-2023-39659
LangChain vulnerable to arbitrary code execution
- Class
- Tool and Agent Misuse (filed by a model that read the advisory)
- Technique
- Code and command execution
- Also involves
- Direct Prompt Injection
- Affected
- langchain (PyPI)
- Gets past
- Sandbox or allowlist
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS
- 1.5% chance of exploitation in 30 days
How it works, in short
The Python AST REPL tool runs supplied scripts without adequate restriction, letting a crafted script execute arbitrary code on the host. (Our summary, written by a model. The source text is below.)
Details
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.
References
- https://nvd.nist.gov/vuln/detail/CVE-2023-39659
- https://github.com/langchain-ai/langchain/issues/7700
- https://github.com/langchain-ai/langchain/pull/12427
- https://github.com/langchain-ai/langchain/pull/5640
- https://github.com/langchain-ai/langchain/commit/cadfce295f8a33828fc635c2e5ea28b883e5c992
- https://github.com/langchain-ai/langchain
- https://github.com/langchain-ai/langchain/releases/tag/v0.0.325
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2023-147.yaml
Source: GitHub Advisory Database, used under CC BY 4.0.