Browse / Direct Prompt Injection / CVE-2023-32785
Langchain SQL Injection vulnerability
- Class
- Direct Prompt Injection (filed by a model that read the advisory)
- Technique
- SQL and query injection
- Also involves
- Improper Output Handling
- Affected
- langchain (PyPI)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
How it works, in short
Prompt text steers the chain to build SQL that the SQL service runs unsafely, letting an attacker execute arbitrary commands against the database. (Our summary, written by a model. The source text is below.)
Details
In Langchain before 0.0.247, prompt injection allows execution of arbitrary code against the SQL service provided by the chain.
References
- https://nvd.nist.gov/vuln/detail/CVE-2023-32785
- https://github.com/langchain-ai/langchain/issues/5923#issuecomment-1696053841
- https://gist.github.com/rharang/9c58d39db8c01db5b7c888e467c0533f
- https://github.com/langchain-ai/langchain
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2026-372.yaml
- https://pypi.org/project/langchain
Source: GitHub Advisory Database, used under CC BY 4.0.