Skip to content
Path traversal Disclosed report Beginner CVE-2025-6209

LlamaIndex vulnerable to Path Traversal attack through its encode_image function

The encode_image function in LlamaIndex did not properly validate the image_path input, allowing path traversal sequences. An attacker could read arbitrary files on the server, including sensitive system files.

run-llama/llama_index

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-2rhq-96q8-4vjq, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely improper validation or sanitisation of the file path passed to encode_image, allowing traversal sequences to escape the intended directory.

What the attacker needed

Ability to control image_path input

The fix

The vulnerability was fixed in version 0.12.41.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A path traversal bug lets someone trick a program into opening files outside the folder it should be limited to, by using special sequences like '../' in a file name. Here, a function that encodes images accepted a file path without checking it, so an attacker could point it at other files on the server and read them.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More from run-llama/llama_index

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.