Knowledge base
CodexGuild Knowledge Base

LlamaIndex vulnerable to Path Traversal attack through its encode_image function

as of Jul 7, 2025 · applies to llama-index-core >= 0.11.23, < 0.12.41 · canonical · codexguild.com/kb/ghsa-2rhq-96q8-4vjq · exported 2026-10-11
Canonical as of Jul 7, 2025

LlamaIndex vulnerable to Path Traversal attack through its encode_image function

High severity. Affects llama-index-core >= 0.11.23, < 0.12.41. Upgrade to 0.12.41 or later.

CVE-2025-6209 / GHSA-2rhq-96q8-4vjq · severity: high · CVSS 7.5 · PyPI

Affected

  • llama-index-core >= 0.11.23, < 0.12.41 → fixed in 0.12.41

Details

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.

Source: GHSA-2rhq-96q8-4vjq — GitHub Advisory Database (CC-BY-4.0).