INCIDENT MAP

Browse / Improper Output Handling / CVE-2024-23751

SQL injection in llama-index

CVE-2024-23751 ยท 2024-01-22 critical

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

Source: GitHub Advisory Database, used under CC BY 4.0.