CVE-2025-6210:
LlamaIndex vulnerability in its ObsidianReader class can lead to Path Traversal exploit
6.2
CVSS ScoreBasic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
llama-index-readers-obsidian | pip | < 0.5.2 | 0.5.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the load_data
method of the ObsidianReader
class in the llama-index-readers-obsidian
package. The core of the issue is a failure to properly sanitize and validate file paths, specifically by not accounting for hardlinks. An attacker could create a hardlink within the Obsidian vault directory that points to a sensitive file elsewhere on the system. When the load_data
method iterates through the files to be processed, it would encounter the hardlink and, without proper checks, treat it as a regular file. The os.path.join
and Path.resolve()
operations would resolve to the path of the linked sensitive file, leading to its contents being read and loaded. The provided patch directly addresses this by introducing a new function, is_hardlink
, which uses os.stat()
to check the number of links to a file's inode (st_nlink
). If a file has more than one link, it is identified as a hardlink and skipped. This check is added at the beginning of the file processing loop within the load_data
method, effectively closing the path traversal loophole.
Vulnerable functions
llama_index.readers.obsidian.base.ObsidianReader.load_data
llama-index-integrations/readers/llama-index-readers-obsidian/llama_index/readers/obsidian/base.py