CVE-2025-1750: LlamaIndex DuckDB: SQL injection enables file R/W and RCE

GHSA-6mcc-q3mg-3qg6CRITICALPoC AVAILABLECISA: ATTEND
Published June 2, 2025
CISO Take

CVE-2025-1750 is an unauthenticated SQL injection in the delete function of the LlamaIndex DuckDB vector store, where an attacker-controlled ref_doc_id can be used to read and write arbitrary files on the server and potentially reach remote code execution. It carries a critical CVSS of 9.8 with network reachability, no privileges and no user interaction, so any application that passes user-influenced document IDs to delete() is exposed. Real-world urgency is moderated by the data: EPSS is only 0.00817 (top 44%), the CVE is not in CISA KEV, and there is no public exploit or Nuclei template, but the llama-index ecosystem has 249 downstream dependents and 13 other CVEs in the same package, so the blast radius is meaningful. Upgrade llama-index-vector-stores-duckdb to 0.12.21 or later, and inventory RAG services that expose document deletion or re-ingestion to untrusted callers.

Sources:NVDEPSSGitHub AdvisoryATLAShuntr.com

What is the risk?

Technical severity is critical: the CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N) shows trivial network exploitation with full confidentiality, integrity and availability impact. Practical exploitation likelihood is currently low to moderate: EPSS is 0.00817, there is no KEV listing, no public PoC and no scanner template. Actual exposure depends on whether untrusted input can reach ref_doc_id in DuckDBVectorStore.delete(), which typically happens only in applications that expose document management endpoints. Affected versions are limited to >= 0.12.19 and < 0.12.21. Because DuckDB can read and write local files, successful exploitation can escalate beyond the database to host compromise. Note that this is an assessment based on the supplied data and has not been independently verified.

How does the attack unfold?

Initial Access
Attacker reaches an application endpoint that passes a user-controlled ref_doc_id to DuckDBVectorStore.delete().
AML.T0049
Exploitation
A crafted ref_doc_id injects SQL that breaks out of the intended delete statement and runs attacker-chosen DuckDB queries.
AML.T0049
Collection
Injected queries read local files such as environment files, API keys and indexed documents from the server.
AML.T0037
Impact
The attacker writes files to achieve remote code execution, then exfiltrates data and tampers with the vector index.

What systems are affected?

PackageEcosystemVulnerable RangePatched
LlamaIndexpip—No patch
52.9K250 dependentsPushed 4d ago82% patched~81d to patchFull package profile →
LlamaIndexpip>= 0.12.19, < 0.12.210.12.21
52.9K250 dependentsPushed 4d ago82% patched~81d to patchFull package profile →

How severe is it?

CVSS 3.1
9.8 / 10
EPSS
0.9%
chance of exploitation in 30 days
Higher than 60% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
○CISA SSVC: Public PoC
○Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AVACPRUISCIA
AVNetwork
ACLow
PRNone
UINone
SUnchanged
CHigh
IHigh
AHigh

What should I do?

1 step
  1. 1) Upgrade llama-index-vector-stores-duckdb to 0.12.21 or later (fix commit 369a2942, release v0.12.21). 2) Identify affected deployments with pip inventory or SBOM scans for versions >= 0.12.19 and < 0.12.21. 3) Until patched, do not pass user-controlled values to DuckDBVectorStore.delete(); validate ref_doc_id against a strict allowlist or UUID format and place authentication and authorization in front of any delete or re-ingest endpoint. 4) Run the application with a least-privilege OS account, a read-only filesystem where possible, and restricted DuckDB file access settings. 5) Detect by reviewing application and database logs for ref_doc_id values containing quotes, semicolons, SQL keywords or file-function calls such as COPY, read_csv or read_text, and monitor for unexpected file creation in application directories. 6) Rotate secrets stored on hosts that ran vulnerable versions and were reachable by untrusted users.

What does CISA's SSVC say?

DecisionAttend
Exploitationpoc
AutomatableYes
Technical Impacttotal

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15-Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6-AI system operation and monitoring
NIST AI RMF
MANAGE 2.3-Response to previously unknown risks
OWASP LLM Top 10
LLM03-Supply ChainLLM08-Vector and Embedding Weaknesses

Frequently Asked Questions

What is CVE-2025-1750?

CVE-2025-1750 is an unauthenticated SQL injection in the delete function of the LlamaIndex DuckDB vector store, where an attacker-controlled ref_doc_id can be used to read and write arbitrary files on the server and potentially reach remote code execution. It carries a critical CVSS of 9.8 with network reachability, no privileges and no user interaction, so any application that passes user-influenced document IDs to delete() is exposed. Real-world urgency is moderated by the data: EPSS is only 0.00817 (top 44%), the CVE is not in CISA KEV, and there is no public exploit or Nuclei template, but the llama-index ecosystem has 249 downstream dependents and 13 other CVEs in the same package, so the blast radius is meaningful. Upgrade llama-index-vector-stores-duckdb to 0.12.21 or later, and inventory RAG services that expose document deletion or re-ingestion to untrusted callers.

Is CVE-2025-1750 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2025-1750, increasing the risk of exploitation.

How to fix CVE-2025-1750?

1) Upgrade llama-index-vector-stores-duckdb to 0.12.21 or later (fix commit 369a2942, release v0.12.21). 2) Identify affected deployments with pip inventory or SBOM scans for versions >= 0.12.19 and < 0.12.21. 3) Until patched, do not pass user-controlled values to DuckDBVectorStore.delete(); validate ref_doc_id against a strict allowlist or UUID format and place authentication and authorization in front of any delete or re-ingest endpoint. 4) Run the application with a least-privilege OS account, a read-only filesystem where possible, and restricted DuckDB file access settings. 5) Detect by reviewing application and database logs for ref_doc_id values containing quotes, semicolons, SQL keywords or file-function calls such as COPY, read_csv or read_text, and monitor for unexpected file creation in application directories. 6) Rotate secrets stored on hosts that ran vulnerable versions and were reachable by untrusted users.

What systems are affected by CVE-2025-1750?

This vulnerability affects the following AI/ML architecture patterns: RAG pipelines, vector databases, LLM application frameworks, document ingestion pipelines.

What is the CVSS score for CVE-2025-1750?

CVE-2025-1750 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.88%.

What is the AI security impact?

Affected AI Architectures

RAG pipelinesvector databasesLLM application frameworksdocument ingestion pipelines

MITRE ATLAS Techniques

AML.T0010.001AI Software
AML.T0036Data from Information Repositories
AML.T0037Data from Local System
AML.T0049Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE 2.3
OWASP LLM Top 10: LLM03, LLM08

What are the technical details?

Original Advisory

An SQL injection vulnerability exists in the delete function of DuckDBVectorStore in run-llama/llama_index version v0.12.19. This vulnerability allows an attacker to manipulate the ref_doc_id parameter, enabling them to read and write arbitrary files on the server, potentially leading to remote code execution (RCE).

Exploitation Scenario

An organization runs an internal knowledge-base chatbot built on LlamaIndex with a DuckDB vector store and exposes an API endpoint that lets users remove documents by ID. An attacker sends a crafted ref_doc_id containing SQL that closes the original statement and uses DuckDB file functions to read the application's environment file and cloud credentials. The attacker then writes a malicious Python file or script to a location the application loads or executes, gaining code execution on the server. From there they exfiltrate the indexed corporate documents, pivot using the stolen LLM and cloud API keys, and tamper with the vector index to influence future answers.

Weaknesses (CWE)

CWE-89 — Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.

  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. For example, consider using persistence layers such as Hibernate or Enterprise Java Beans, which can provide significant protection against SQL injection if used properly.
  • [Architecture and Design] If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated. Process SQL queries using prepared statements, parameterized queries, or stored procedures. These features should accept parameters or variables and support strong typing. Do not dynamically construct and execute query strings within these features using "exec" or similar functionality, since this may re-introduce the possibility of SQL injection. [REF-867]

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
June 2, 2025
Last Modified
October 2, 2026
First Seen
October 3, 2026

Related Vulnerabilities