Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-11958

CVE-2024-11958: Llamaindex SQL Injection Vulnerability

CVE-2024-11958 is a SQL injection flaw in Llamaindex duckdb_retriever that enables remote code execution through malicious SQL queries. This article covers the technical details, affected versions, and mitigation steps.

Published: April 15, 2026

CVE-2024-11958 Overview

A SQL injection vulnerability exists in the duckdb_retriever component of the run-llama/llama_index repository. 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.

Critical Impact

Unauthenticated attackers can exploit this SQL injection vulnerability to achieve remote code execution on systems running LlamaIndex with the DuckDB retriever component, potentially leading to complete system compromise.

Affected Products

  • LlamaIndex DuckDB Retriever versions prior to 0.4.0
  • Applications using llama-index-retrievers-duckdb-retriever package
  • Systems integrating LlamaIndex with DuckDB for retrieval-augmented generation (RAG)

Discovery Timeline

  • 2025-03-20 - CVE CVE-2024-11958 published to NVD
  • 2025-07-29 - Last updated in NVD database

Technical Details for CVE-2024-11958

Vulnerability Analysis

This vulnerability represents a classic SQL injection flaw in an AI/ML framework context. The duckdb_retriever component constructs SQL queries by directly concatenating user-supplied input without proper sanitization or parameterization. DuckDB, being an embedded analytical database, supports extensions that can interact with the file system. Attackers can leverage this capability by injecting SQL commands that install the shellfs extension, which provides file system access and command execution capabilities.

The exploitation chain involves: injecting malicious SQL through the retriever interface, installing the shellfs extension via DuckDB's extension mechanism, and then executing arbitrary shell commands on the underlying system. This transforms what might appear to be a database vulnerability into a full remote code execution primitive.

Root Cause

The root cause is the failure to use prepared statements when constructing SQL queries in the DuckDBRetriever class. User-controlled input from query operations is directly interpolated into SQL strings, creating an injection point. The fix addresses this by implementing proper parameterized queries using DuckDB's prepared statement functionality, ensuring that user input is treated as data rather than executable SQL code.

Attack Vector

The attack is network-accessible and requires no authentication or user interaction. An attacker can send specially crafted queries to an application using the vulnerable DuckDB retriever component. The malicious payload would contain SQL injection sequences that break out of the intended query context and execute attacker-controlled SQL statements.

The attack chain typically follows this pattern:

  1. Attacker identifies an application using LlamaIndex with DuckDB retriever
  2. Malicious query input is submitted containing SQL injection payload
  3. The payload installs the shellfs extension via INSTALL shellfs; LOAD shellfs;
  4. Subsequent payload executes system commands through shellfs functions
  5. Attacker achieves remote code execution on the target system
python
 import os
 from typing import List, Optional
 
+import duckdb
 from llama_index.core.base.base_retriever import BaseRetriever
 from llama_index.core.callbacks.base import CallbackManager
 from llama_index.core.constants import DEFAULT_SIMILARITY_TOP_K
-from llama_index.core.schema import TextNode, NodeWithScore, QueryBundle
+from llama_index.core.schema import NodeWithScore, QueryBundle, TextNode
 
 logger = logging.getLogger(__name__)
-import_err_msg = "`duckdb` package not found, please run `pip install duckdb`"
 
 
 class DuckDBLocalContext:

Source: GitHub Commit

Detection Methods for CVE-2024-11958

Indicators of Compromise

  • Unexpected DuckDB extension installations, particularly shellfs or other file-system related extensions
  • Anomalous SQL query patterns containing INSTALL, LOAD, or system command execution syntax
  • Unusual process spawning from Python processes running LlamaIndex applications
  • File system access or modifications from DuckDB database processes

Detection Strategies

  • Monitor application logs for SQL error messages indicating injection attempts with malformed queries
  • Implement query logging in DuckDB to capture and analyze executed SQL statements for injection patterns
  • Deploy web application firewall (WAF) rules to detect common SQL injection payloads in API requests
  • Use runtime application self-protection (RASP) to detect unexpected SQL execution patterns

Monitoring Recommendations

  • Enable verbose logging for LlamaIndex retriever operations to capture query details
  • Monitor for process creation events from Python interpreter processes running AI/ML workloads
  • Implement file integrity monitoring on systems hosting LlamaIndex applications
  • Set up alerts for DuckDB extension loading events in production environments

How to Mitigate CVE-2024-11958

Immediate Actions Required

  • Upgrade llama-index-retrievers-duckdb-retriever to version 0.4.0 or later immediately
  • Audit applications using LlamaIndex with DuckDB for potential exposure to this vulnerability
  • Review access controls and network segmentation for systems running vulnerable versions
  • Implement input validation at the application layer as defense-in-depth

Patch Information

The vulnerability has been addressed in commit 35bd221e948e40458052d30c6ef2779bc965b6d0, which implements prepared statements in the DuckDBRetriever component. The fix is available in llama-index-retrievers-duckdb-retriever version 0.4.0. The patch properly imports the DuckDB module directly and refactors query construction to use parameterized queries instead of string concatenation.

For additional technical details, refer to the Huntr Bounty Report and the GitHub security commit.

Workarounds

  • Disable or remove the DuckDB retriever component if not actively required until patching is possible
  • Implement strict input validation and sanitization before data reaches the retriever layer
  • Deploy network segmentation to limit exposure of vulnerable LlamaIndex services
  • Configure DuckDB to run in restricted mode, disabling extension loading if feasible for your use case
bash
# Upgrade to patched version
pip install --upgrade llama-index-retrievers-duckdb-retriever>=0.4.0

# Verify installed version
pip show llama-index-retrievers-duckdb-retriever | grep Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeSQLI

  • Vendor/TechLlamaindex

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability1.17%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-89
  • Technical References
  • Huntr Bounty Details
  • Vendor Resources
  • GitHub Commit Overview
  • Related CVEs
  • CVE-2025-1750: Llamaindex DuckDBVectorStore SQLi Vulnerability

  • CVE-2025-1793: Llamaindex SQL Injection Vulnerability

  • CVE-2024-12909: Llamaindex SQL Injection Vulnerability

  • CVE-2024-23751: LlamaIndex SQL Injection Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English