CVE-2024-11958 is a critical-severity (CVSS 9.8) SQL Injection vulnerability in llama-index-retrievers-duckdb-retriever. A fix is available for llama-index-retrievers-duckdb-retriever — see the affected versions and patch details below.
SQL Injection in run-llama/llama_index
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-11958.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
llama-index-retrievers-duckdb-retrieverReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
A SQL injection vulnerability exists in the duckdb_retriever component of the run-llama/llama_index repository, specifically in llama-index-retrievers-duckdb-retriever prior to v0.4.0. The vulnerability arises from the construction of SQL queries without using prepared statements, allowing an attacker to inject arbitrary SQL code. This can lead to remote code execution (RCE) by installing the shellfs extension and executing malicious commands.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | llama-index-retrievers-duckdb-retriever | all versions | 0.4.0pip install --upgrade 'llama-index-retrievers-duckdb-retriever==0.4.0' |
Affected Products
llamaindexllamaindexDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for llama-index-retrievers-duckdb-retriever, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update llama-index-retrievers-duckdb-retriever to 0.4.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-11958 is resolved across your whole dependency graph.
Workarounds
Until you can upgrade, make sure every query built from user input uses parameterised statements or a prepared-statement API rather than string concatenation, and reduce the database account's privileges so an injected query cannot read or alter data beyond what the feature needs.
Frequently Asked Questions
Is CVE-2024-11958 in your dependencies?
Find it across PyPI, including transitive dependencies.