Executive brief
LangChain, a popular framework for building applications with large language models, is vulnerable to a critical security flaw. An attacker can remotely execute malicious code on the system running the software by exploiting how it handles certain Python execution parameters. This could lead to a full system takeover, data theft, or disruption of services.
Technical details
A remote code execution (RCE) vulnerability exists in LangChain due to improper neutralization of special elements used in downstream components (CWE-74). The flaw is located within the PALChain parameter of the Python exec method, where externally-influenced input is insufficiently sanitized before being executed. A remote, unauthenticated attacker can exploit this by providing crafted input that triggers arbitrary command execution on the host system. The vulnerability is addressed in version 0.0.247.
Affected products
- langchain-ai langchain < 0.0.247
Timeline
- 2023-07-06: advisory
- 2023-07-06: disclosed
- 2023-07-06: patched