LlamaIndex SQL injection via prompt in NLSQLTableQueryEngine
Date: 2024-01
Affected: llama_index <= 0.9.34
Attack vector: sql-injection
Category: real-world
Severity: Critical
CVE: CVE-2024-12704
CVE-2024-12910
CVE-2024-12911
CVE-2024-14021
CVE-2024-23751
CVE-2024-3098
CVE-2024-3271
CVE-2024-4181
CVE-2024-45201
CVE-2024-58339
CVE-2025-1752
CVE-2025-1793
CVE-2025-3044
CVE-2025-3046
CVE-2025-3108
CVE-2025-5302
CVE-2025-5472
CVE-2025-6208
CVE-2025-6209
CVE-2025-6211
CVE-2025-7647
CVE-2025-7707
CWE: CWE-1112
CWE-22
CWE-29
CWE-377
CWE-378
CWE-400
CWE-440
CWE-502
CWE-674
CWE-77
CWE-770
CWE-835
CWE-89
CWE-94
CVSS: 8.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

LlamaIndex (llama_index) through 0.9.34 allows SQL injection in the NLSQLTableQueryEngine when an attacker can control the natural-language query, which is translated to SQL and executed without proper safeguards.


Mitigations:

Architectural layers (MAESTRO):