---
id: CVE-2025-6209
aliases:
  - GHSA-2rhq-96q8-4vjq
  - PYSEC-2025-65
  - PYSEC-2026-1558
title: >-
  LlamaIndex vulnerable to Path Traversal attack through its encode_image
  function
summary: >-
  LlamaIndex vulnerable to Path Traversal attack through its encode_image
  function
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'
vendor: llama-index-core
product: llama-index-core
ecosystem: pip
affected:
  - 'llama-index-core >= 0.11.23, < 0.12.41'
patched:
  - llama-index-core 0.12.41
published: '2025-07-07'
updated: '2026-07-07'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-2rhq-96q8-4vjq'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2025-6209'
  - url: >-
      https://github.com/run-llama/llama_index/commit/cdeaab91a204d1c3527f177dac37390327aef274
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/llama-index/PYSEC-2025-65.yaml
  - url: 'https://github.com/run-llama/llama_index'
  - url: 'https://huntr.com/bounties/e89d14f8-bfe8-4c9a-bb2a-656c01cc9a68'
tags:
  - osv
  - pip
epss: 0.00545
epssPercentile: 0.43333
ingestedAt: '2026-07-08T18:25:44.616Z'
---

## Overview

A path traversal vulnerability exists in run-llama/llama_index versions 0.11.23 through 0.12.40, specifically within the `encode_image` function in `generic_utils.py`. This vulnerability allows an attacker to manipulate the `image_path` input to read arbitrary files on the server, including sensitive system files. The issue arises due to improper validation or sanitization of the file path, enabling path traversal sequences to access files outside the intended directory. The vulnerability is fixed in version 0.12.41.

## Affected packages

- `llama-index-core >= 0.11.23, < 0.12.41`

## Remediation

Upgrade to a patched release:

- `llama-index-core 0.12.41`
