PyPI: llama-index-core

CVE-2025-6209

Safety vulnerability ID: SFTY-20250707-26427

Safety legacy ID: pyup.io-77994

Affected versions of the LlamaIndex package are vulnerable to Path Traversal. The `encode_image()` function in `generic_utils.py` fails to properly validate and sanitize file path inputs, leading to unauthorized file access. An attacker can exploit this vulnerability by manipulating the `image_path` parameter with path traversal sequences, resulting in the ability to read arbitrary files on the server, including sensitive system files. The vulnerability was fixed in version 0.12.41 through the implementation of path validation checks. The fix adds the `is_valid_path()` and `is_valid_url()` functions to validate input paths and URLs.

Created at: Nov 6, 2025Updated at: Nov 6, 2025

Overview

LlamaIndex vulnerable to Path Traversal attack through its encode_image function

Advisory

Affected versions of the LlamaIndex package are vulnerable to Path Traversal. The `encode_image()` function in `generic_utils.py` fails to properly validate and sanitize file path inputs, leading to unauthorized file access. An attacker can exploit this vulnerability by manipulating the `image_path` parameter with path traversal sequences, resulting in the ability to read arbitrary files on the server, including sensitive system files. The vulnerability was fixed in version 0.12.41 through the implementation of path validation checks. The fix adds the `is_valid_path()` and `is_valid_url()` functions to validate input paths and URLs.

Affected Package

Affecting llama-index-core package, versions
>=0.11.23,<0.12.41

Also affects

---

How to Fix

Upgrade
llama-index-core
to
0.12.41
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more