A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-2025-6209

CVE-2025-6209: Llamaindex Path Traversal Vulnerability

CVE-2025-6209 is a path traversal vulnerability in Llamaindex that allows attackers to read arbitrary files on the server. This article covers the technical details, affected versions, security impact, and mitigation.

Updated: May 19, 2026

CVE-2025-6209 Overview

CVE-2025-6209 is a path traversal vulnerability [CWE-29] in the run-llama/llama_index Python library. The flaw resides in the encode_image function within generic_utils.py and affects versions 0.12.27 through 0.12.40. An unauthenticated network attacker can manipulate the image_path parameter to read arbitrary files on the host filesystem. The issue stems from missing validation and sanitization of file path inputs, which allows traversal sequences like ../ to escape the intended directory. The vulnerability is fixed in version 0.12.41.

Critical Impact

Attackers can read arbitrary files on the server, including sensitive system files such as /etc/passwd, configuration files, and application secrets, by supplying crafted image_path values to applications built on llama_index.

Affected Products

  • llama_index versions 0.12.27 through 0.12.40
  • Applications embedding the vulnerable encode_image utility from llama_index.core
  • LLM workflows that pass user-controlled image paths to llama_index multimodal components

Discovery Timeline

  • 2025-07-07 - CVE-2025-6209 published to NVD
  • 2025-07-30 - Last updated in NVD database

Technical Details for CVE-2025-6209

Vulnerability Analysis

The encode_image helper in llama_index/core/generic_utils.py accepts a file path and returns the base64-encoded contents of the referenced image. The function passes the caller-supplied image_path directly to file system operations without enforcing a base directory or rejecting traversal sequences. When the image_path is influenced by untrusted input, an attacker can supply values such as ../../../../etc/passwd to coerce the function into reading files outside the intended image directory.

Because llama_index is widely embedded in Retrieval-Augmented Generation (RAG) and multimodal LLM applications, the function is often reachable through HTTP endpoints, agent tools, or document ingestion pipelines that accept user-supplied references. The resulting file contents are returned to the caller or fed into downstream model prompts, where they can be exfiltrated.

Root Cause

The root cause is improper limitation of a pathname to a restricted directory [CWE-29]. The encode_image function does not canonicalize the input path, does not verify that the resolved path remains within an allowed directory, and does not validate that the target file is actually an image.

Attack Vector

Exploitation requires only network access to an application exposing llama_index image-handling functionality. No authentication or user interaction is required. The attacker supplies a crafted image_path containing directory traversal sequences, and the application returns or processes the contents of arbitrary readable files.

python
# Patch excerpt from llama-index-core/llama_index/core/schema.py
# Adds PIL-based image validation to ImageDocument path/url handling
from dataclasses_json import DataClassJsonMixin
from deprecated import deprecated
from typing_extensions import Self
from PIL import Image

from llama_index.core.bridge.pydantic import (
    AnyUrl,

Source: run-llama/llama_index commit cdeaab9

The patch introduces PIL.Image validation so that ImageDocument path and URL inputs are confirmed to be valid image data before being processed, limiting the ability to redirect the loader at arbitrary non-image files.

Detection Methods for CVE-2025-6209

Indicators of Compromise

  • HTTP request parameters or JSON fields named image_path, image, or path containing traversal sequences such as ../, ..\\, %2e%2e%2f, or absolute paths like /etc/, /root/, or C:\\Windows\\.
  • Application logs showing encode_image calls that resolve to files outside the configured image directory.
  • Outbound LLM responses or API responses containing contents of system files (/etc/passwd, .env, id_rsa, config.yaml).

Detection Strategies

  • Inspect Python application logs and web server access logs for requests targeting llama_index endpoints with encoded or literal .. sequences in path-like parameters.
  • Instrument calls to encode_image to log resolved absolute paths and alert when the path falls outside an approved image directory.
  • Apply static analysis to identify code that passes externally sourced data into llama_index image loading utilities without canonicalization.

Monitoring Recommendations

  • Monitor file system access from the Python interpreter for reads of sensitive paths such as /etc/shadow, /proc/self/environ, SSH keys, and cloud credential files.
  • Track installed llama-index-core package versions across environments and alert on versions between 0.12.27 and 0.12.40.
  • Correlate anomalous file reads with subsequent egress traffic from the application host to detect data exfiltration following path traversal.

How to Mitigate CVE-2025-6209

Immediate Actions Required

  • Upgrade llama-index-core to version 0.12.41 or later across all environments using the affected package.
  • Audit application code for any path-handling routine that forwards user-controlled values to encode_image or ImageDocument and add server-side allow-list validation.
  • Restrict the filesystem permissions of the process running llama_index so it cannot read sensitive system files or credential stores.

Patch Information

The vulnerability is fixed in llama_index version 0.12.41. The fix is implemented in commit cdeaab91a204d1c3527f177dac37390327aef274, which adds PIL.Image validation to ImageDocument path and URL inputs. Additional context is available in the Huntr bounty submission.

Workarounds

  • Validate that all image_path inputs resolve, via os.path.realpath, to a location within an explicit allow-listed directory before invoking encode_image.
  • Reject any input containing .., null bytes, URL-encoded traversal sequences, or absolute paths before passing it to llama_index APIs.
  • Run llama_index workloads under a dedicated low-privilege service account with read access limited to the required image directory.
bash
# Upgrade to the patched release
pip install --upgrade 'llama-index-core>=0.12.41'

# Verify the installed version
python -c "import llama_index.core, importlib.metadata as m; print(m.version('llama-index-core'))"

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

  • Vulnerability Details
  • TypePath Traversal

  • Vendor/TechLlamaindex

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.44%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-29
  • Technical References
  • Huntr Bounty Submission
  • Vendor Resources
  • GitHub Commit Reference
  • Related CVEs
  • CVE-2025-1752: Llamaindex Llamaindex DoS Vulnerability

  • CVE-2025-1753: Llamaindex CLI RCE Vulnerability

  • CVE-2025-1750: Llamaindex DuckDBVectorStore SQLi Vulnerability

  • CVE-2025-1793: Llamaindex SQL Injection Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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