CVE-2025-1750: LlamaIndex DuckDBVectorStore SQL Injection Vulnerability
Summary
CVE-2025-1750: LlamaIndex DuckDBVectorStore vulnerable to SQL injection through ref_doc_id. Affects llama-index-vector-stores-duckdb versions >= 0.12.19, < 0.12.21. Fixed in 0.12.21. How to fix ↓
Also tracked for
- llama-index · PyPI
The same CVE-2025-1750 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
LlamaIndex is a package designed for managing and querying vector stores, particularly using DuckDB as a backend. It allows users to efficiently store and retrieve high-dimensional vectors, making it suitable for applications in machine learning and data analysis. However, a critical vulnerability has been identified in the DuckDBVectorStore component, which can be exploited through SQL injection, posing significant risks to data integrity and system security.
Vulnerability Detail
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). The flaw arises from insufficient validation of user input, which can be exploited to execute unauthorized SQL commands.
How To Fix
Latest published version: 0.7.0 as of 22 Oct 2026
pip install --upgrade "llama-index-vector-stores-duckdb==0.7.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.12.21
This is the first release that contains the fix.
pip install --upgrade "llama-index-vector-stores-duckdb==0.12.21"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can implement input validation on the ref_doc_id parameter to sanitize user inputs and prevent SQL injection attacks. Ensure that only expected values are processed by the delete function.
Conclusion
The SQL injection vulnerability in LlamaIndex's DuckDBVectorStore poses significant risks to applications utilizing this package. It is crucial to update to the latest version to mitigate potential threats. Additionally, implementing input validation can serve as a temporary measure until an update can be applied.
See every vulnerability recorded for llama-index-vector-stores-duckdb →
FAQ
The vulnerability is an SQL injection flaw that allows attackers to manipulate database queries through the ref_doc_id parameter.
Exploitation of this vulnerability can lead to unauthorized access to sensitive data, data corruption, or even remote code execution on the server.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors open-source vulnerabilities without requiring sign-up.
If an immediate update is not possible, implement input validation as a temporary measure to mitigate the risk of SQL injection.
The CVSS score of this vulnerability is 9.8, indicating a critical level of severity.