---
id: CVE-2024-11958
aliases:
  - GHSA-339r-cjv9-x78g
  - PYSEC-2026-399
title: ' LlamaIndex Retrievers Integration: DuckDBRetriever SQL Injection'
summary: ' LlamaIndex Retrievers Integration: DuckDBRetriever SQL Injection'
severity: critical
cvss: 9.8
cvssVector: 'CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'
vendor: llama-index-retrievers-duckdb-retriever
product: llama-index-retrievers-duckdb-retriever
ecosystem: pip
affected:
  - llama-index-retrievers-duckdb-retriever < 0.4.0
patched:
  - llama-index-retrievers-duckdb-retriever 0.4.0
published: '2025-03-20'
updated: '2026-07-21'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-339r-cjv9-x78g'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2024-11958'
  - url: >-
      https://github.com/run-llama/llama_index/commit/35bd221e948e40458052d30c6ef2779bc965b6d0
  - url: 'https://github.com/advisories/GHSA-339r-cjv9-x78g'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/llama-index-retrievers-duckdb-retriever/PYSEC-2026-399.yaml
  - url: 'https://github.com/run-llama/llama_index'
  - url: 'https://huntr.com/bounties/8ddf66e1-f74c-4d53-992b-76bc45cacac1'
  - url: 'https://pypi.org/project/llama-index-retrievers-duckdb-retriever'
tags:
  - osv
  - pip
epss: 0.01444
epssPercentile: 0.72138
ingestedAt: '2026-07-21T19:04:56.086Z'
---

## Overview

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

- `llama-index-retrievers-duckdb-retriever < 0.4.0`

## Remediation

Upgrade to a patched release:

- `llama-index-retrievers-duckdb-retriever 0.4.0`
