CVE-2024-12911: LlamaIndex vulnerable to Creation of Temporary File in Directory with Insecure Permissions
LlamaIndex's `JSONalyzeQueryEngine` builds SQL from LLM output, so a prompt injection can turn into SQL injection through `default_jsonalyzer`. The result is arbitrary file creation and denial of service on the host. The fix in llama-index 0.12.3 moves the engine out of core into `llama-index-experimental`, where it carries a security warning.
Published Mar 20, 2025 · Updated Oct 15, 2025 · Analysis Nov 1, 2026
What an attacker can do
JSONalyzeQueryEngine answers questions about JSON by asking an LLM to write SQL, then running that SQL against an in-memory SQLite table created by default_jsonalyzer. The LLM sees the user's query, so text in the question or in the JSON data can steer the generated SQL. That is prompt injection leading to SQL injection (CWE-89).
SQLite lets a statement create or attach database files. An attacker can use that to create files at paths of their choosing, or to run heavy statements that stall the service (CWE-379 is also assigned for the temporary file handling). The scores show file integrity impact as low and availability as high, with user interaction required, because the attacker needs a user or application to submit the poisoned text or data.
Any app that exposes a JSON question-answering feature built on this engine to untrusted users is in scope. The sources show no data theft path and no code execution.
Who is affected
Affected: llama-index below 0.12.3, for applications that use JSONalyzeQueryEngine. Applications that never use that class are not affected.
pip show llama-index llama-index-coreThen search your code for JSONalyzeQueryEngine and jsonalyze. The engine lives in llama_index.core.query_engine in affected releases.
llama-index
- Ecosystem
- PyPI
- Affected
- < 0.12.3
- Fixed in
- 0.12.3
- Check
pip show llama-index
How to fix it
Upgrade to llama-index 0.12.3:
pip install --upgrade "llama-index>=0.12.3"The fix commit, "Move JSONalyzeQueryEngine to experimental", replaces the core class with a stub that raises a DeprecationWarning and points to llama-index-experimental. The experimental module now carries a docstring warning about arbitrary file creation. So the fix removes the engine from core instead of sanitising its SQL. If you still need it, install llama-index-experimental and treat the engine as unsafe for untrusted input. Do not expose it to untrusted users.
How to tell if you were hit
Search application logs for LLM-generated SQL passed to default_jsonalyzer that contains ATTACH, CREATE, file paths or very large cross joins. Look for unexpected new .db or other files on the host written by the app's user, especially in temp or working directories.
Watch for queries to the JSON feature that hang or spike CPU. In code, grep for JSONalyzeQueryEngine to find every place the engine is reachable from user input.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A vulnerability in the default_jsonalyzer function of the JSONalyzeQueryEngine in the run-llama/llama_index repository allows for SQL injection via prompt injection. This can lead to arbitrary file creation and Denial-of-Service (DoS) attacks. The vulnerability affects the latest version and is fixed in version 0.12.3.
Questions
- Which version fixes CVE-2024-12911?
llama-index 0.12.3. The fix moves
JSONalyzeQueryEnginefrom core intollama-index-experimentaland leaves a deprecated stub behind.- Is the SQL now sanitised?
Per the fix commit, no. The class was moved to experimental with a security warning about arbitrary file creation. The commit does not add SQL filtering.
- Does it need user interaction?
Yes, according to the vector. A user or app must submit text or data that carries the injected instructions to the LLM.
- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LlamaIndex vulnerabilities
All LlamaIndex entriesCVE-2025-6208
llama-index-core vulnerable to Uncontrolled Resource Consumption
medium5.3Feb 2, 2026CVE-2025-7707
llama-index has Insecure Temporary File
high7.1Oct 13, 2025CVE-2025-7647
llama-index-core insecurely handles temporary files
high7.3Sep 27, 2025CVE-2025-5302
LlamaIndex affected by a Denial of Service (DOS) in JSONReader
high8.6Aug 26, 2025CVE-2025-6211
LlamaIndex vulnerable to data loss through hash collisions in its DocugamiReader class
medium6.5Jul 10, 2025CVE-2025-3108
LlamaIndex has Incomplete Documentation of Program Execution related to JsonPickleSerializer component
medium5.0Jul 7, 2025
