# CVE-2024-58339: LlamaIndex <= 0.12.2 VannaQueryEngine SQL Execution Allows Resource Exhaustion

- Severity: High 8.7 (CVSS:4.0, scored by VulnCheck) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.04%, higher than 63% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-01-12T23:04:25.256Z
- Modified: 2026-07-28T01:47:43.838Z
- Also known as: PYSEC-2026-86
- Weaknesses: CWE-770
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: VulnCheck

## 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().

(As written by CVE List.)

## Affected

- run-llama llama_index: up to 0.12.2
- llamaindex llamaindex: up to 0.12.2
- llama-index (PyPI): before 0.12.3

## Every score

- VulnCheck: CVSS:4.0 8.7 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://huntr.com/bounties/a1d6c30d-fce0-412a-bd22-14e0d4c1fa1f> (exploit, evidence, technical-description, third-party-advisory)
- <https://www.llamaindex.ai/> (product, web)
- <https://github.com/run-llama/llama_index> (package, product, third-party-advisory)
- <https://www.vulncheck.com/advisories/llamaindex-vannaqueryengine-sql-execution-allows-resource-exhaustion> (advisory, third-party-advisory)

## Sources

- CVE List: [CVE-2024-58339](https://www.cve.org/CVERecord?id=CVE-2024-58339), CVE Terms of Use, modified 2026-07-28
- NVD: [CVE-2024-58339](https://nvd.nist.gov/vuln/detail/CVE-2024-58339), Public domain, modified 2026-07-14
- PyPA Advisory Database: [PYSEC-2026-86](https://osv.dev/vulnerability/PYSEC-2026-86), CC-BY-4.0, modified 2026-05-20

---

Page: https://cve.day/CVE-2024-58339 · Whole record: https://cve.day/CVE-2024-58339.json · Rebuilt by cve.day 2026-11-25T22:58:52.960Z
