CVE-2024-12911
High · 7.1LlamaIndex vulnerable to Creation of Temporary File in Directory with Insecure Permissions
CVSS
7.1
EPSS
0.5%
Published
Mar 20, 2025
CISA due date
—
Cloudanix analysis
A flaw in certain AI query tools lets attackers send specially crafted instructions that can create unwanted files or shut down the service.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- Library
- Class
- SQL Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw permits prompt injection into the default_jsonalyzer function of JSONalyzeQueryEngine, resulting in unsanitized SQL execution that enables arbitrary file creation on the host and resource exhaustion for denial-of-service.
Why it matters to the business
Attackers can corrupt or exfiltrate data through file operations, interrupt AI-driven query services, and force unplanned downtime or costly recovery efforts; the issue affects widely used LLM tooling with many downstream dependents.
How an attack unfolds
An attacker supplies a crafted natural-language prompt that is processed by JSONalyzeQueryEngine; the default_jsonalyzer function fails to neutralize the input, allowing injected SQL statements to execute, create arbitrary files, or consume excessive resources.
How to fix it
Upgrade the affected package to version 0.12.3 or later; apply the equivalent commit 052e2a1a425c7b04d569399c5276a161d493a40f for combodo/itop deployments; validate that prompt-handling paths no longer pass unsanitized input to SQL engines.
How to confirm the fix worked
Review release notes and changelogs for the 0.12.3 update; run integration tests that submit known malicious prompts and confirm SQL statements are rejected or parameterized; scan dependency manifests to verify the fixed version is deployed.
Typical attack path
- Identify an application exposing the vulnerable JSONalyzeQueryEngine endpoint or integration.
- Craft a prompt containing SQL syntax that bypasses sanitization in default_jsonalyzer.
- Submit the prompt to trigger SQL execution.
- Observe successful file creation or service degradation confirming exploitation.
- Escalate by chaining file writes into further persistence or data access.
How to detect it
Inspect application and database logs for unexpected SQL statements containing file-system operations or unusual resource spikes; correlate prompt inputs with downstream SQL activity in LLM orchestration logs.
What your security team should do
- Immediately upgrade all instances to the fixed version 0.12.3.
- Implement input validation and output escaping around all LLM-to-SQL query paths as a defense-in-depth measure.
- Monitor for unusual file creation or high resource usage originating from query-engine processes.
- Add the vulnerability to internal scanning policies until patch deployment is confirmed across the fleet.
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | llama-index | 0 | 0.12.3 |
Related vulnerabilities
- CVE-2025-7707 llama-index has Insecure Temporary File Also affects llama-index
- CVE-2025-6211 LlamaIndex vulnerable to data loss through hash collisions in its DocugamiReader class Also affects llama-index
- CVE-2025-1793 llama_index vulnerable to SQL Injection Also affects llama-index
- CVE-2024-12910 LlamaIndex Uncontrolled Resource Consumption vulnerability Also affects llama-index
- CVE-2024-4181 A command injection vulnerability exists in the RunGptLLM class of the llama_index… Also affects llama-index
- CVE-2024-23751 LlamaIndex (aka llama_index) through 0.9.34 allows SQL injection via the Text-to-SQL… Also affects llama-index
- CVE-2026-118990 CallBackery versions before 0.62.0 for Perl leave a world-readable dump of the… CWE-379
- CVE-2026-119193 PHPUnit is a testing framework for PHP. CWE-379