CVE-2025-1750: LlamaIndex DuckDB: SQL injection enables file R/W and RCE
GHSA-6mcc-q3mg-3qg6CRITICALPoC AVAILABLECISA: ATTENDCVE-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.
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?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| LlamaIndex | pip | — | No patch |
| LlamaIndex | pip | >= 0.12.19, < 0.12.21 | 0.12.21 |
How severe is it?
What is the attack surface?
What should I do?
1 step1) 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?
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:
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
MITRE ATLAS Techniques
AML.T0010.001AI SoftwareAML.T0036Data from Information RepositoriesAML.T0037Data from Local SystemAML.T0049Exploit Public-Facing ApplicationCompliance Controls Affected
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:HReferences
- github.com/advisories/GHSA-6mcc-q3mg-3qg6
- github.com/pypa/advisory-database/tree/main/vulns/llama-index/PYSEC-2025-245.yaml
- github.com/run-llama/llama_index/commit/369a2942df2efcf6b74461c45d20a0af1fbe4ae2
- github.com/run-llama/llama_index/releases/tag/v0.12.21
- huntr.com/bounties/e1302233-9180-4269-9047-1526247d2cd8
- nvd.nist.gov/vuln/detail/CVE-2025-1750
- github.com/ARPSyndicate/cve-scoresExploit
- github.com/Threekiii/CVEExploit
- github.com/a1batr0ssG/VulhubExpandExploit
- github.com/tanjiti/sec_profileExploit
- github.com/zxarj/wxvlExploit
Timeline
Related Vulnerabilities
CVE-2024-1290910.0llama-index finchat: SQL injection enables RCE
Same package: llama-indexCVE-2025-17939.8llama_index: SQL injection in vector store integrations
Same package: llama-indexCVE-2024-119589.8llama-index DuckDB retriever: SQLi enables RCE
Same package: llama-indexCVE-2025-17537.8llama-index-cli: OS command injection enables RCE
Same package: llama-indexCVE-2025-32257.5llama-index Papers Loader: XML expansion DoS
Same package: llama-index