NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LlamaIndex

CVE-2024-12911: LlamaIndex vulnerable to Creation of Temporary File in Directory with Insecure Permissions

highCVSS 3.0 7.1GHSA-jmgm-gx32-vp4w

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-core

Then 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 JSONalyzeQueryEngine from core into llama-index-experimental and 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 entries