CVE-2024-58339 LlamaIndex <= 0.12.2 VannaQueryEngine SQL Execution Allows Resource Exhaustion
Attackers can cause denial of service by submitting prompts that trigger unbounded SQL execution in LlamaIndex's VannaQueryEngine.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-58339?
CVE-2024-58339 is a high-severity denial of service vulnerability in run-llama llama_index, published on 12 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
LlamaIndex (run-llama/llama_index) versions up to and including 0.12.2 contain an uncontrolled resource consumption vulnerability in the VannaPack VannaQueryEngine implementation. The custom_query() logic generates SQL statements from a user-supplied prompt and executes them via vn.run_sql() without enforcing query execution limits In downstream deployments where untrusted users can supply prompts, an attacker can trigger expensive or unbounded SQL operations that exhaust CPU or memory resources, resulting in a denial-of-service condition. The vulnerable execution path occurs in llama_index/packs/vanna/base.py within custom_query().
Weakness: CWE-770
Which versions are affected by CVE-2024-58339?
1 open source package ship an affected version, including llama-index. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
llama-index PyPI | All versions | 0.12.3 |
Products include Llamaindex Llamaindex.
How do I fix CVE-2024-58339?
Upgrade llama-index to 0.12.3 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2024-58339 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-58339 exists.
Other vulnerabilities in run-llama llama_index
Sources
Also known as GHSA-h7v7-pr65-4w53, PYSEC-2026-86.