Browse / Improper Output Handling / CVE-2024-23751
SQL injection in llama-index
- Class
- Improper Output Handling (filed by a model that read the advisory)
- Technique
- SQL and query injection
- Also involves
- Direct Prompt Injection
- Affected
- llama-index (PyPI)
- CVSS
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS
- 0.7% chance of exploitation in 30 days
How it works, in short
Natural-language input is turned into SQL by the text-to-SQL engines and executed without restriction, so prompts can produce destructive queries. (Our summary, written by a model. The source text is below.)
Details
LlamaIndex (aka llama_index) through 0.9.35 allows SQL injection via the Text-to-SQL feature in NLSQLTableQueryEngine, SQLTableRetrieverQueryEngine, NLSQLRetriever, RetrieverQueryEngine, and PGVectorSQLQueryEngine. For example, an attacker might be able to delete this year's student records via "Drop the Students table" within English language input.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-23751
- https://github.com/run-llama/llama_index/issues/9957
- https://github.com/pypa/advisory-database/tree/main/vulns/llama-index/PYSEC-2024-12.yaml
- https://github.com/run-llama/llama_index
Source: GitHub Advisory Database, used under CC BY 4.0.