Miggo Logo

CVE-2025-6210:
LlamaIndex vulnerability in its ObsidianReader class can lead to Path Traversal exploit

6.2

CVSS Score

Basic Information

EPSS Score
-
Published
7/7/2025
Updated
7/8/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
llama-index-readers-obsidianpip< 0.5.20.5.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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
The `load_data` method is responsible for reading files from a specified directory. Before the patch, it did not check if a file was a hardlink. This allowed an attacker to create a hardlink to a sensitive system file (e.g., /etc/passwd) within the directory being processed. The `load_data` function would then follow this hardlink and read the contents of the sensitive file, bypassing path restrictions. The patch introduces a call to the `is_hardlink` function to detect and skip such files, thus mitigating the path traversal vulnerability.

WAF Protection Rules

WAF Rule

* vuln*r**ility in t** O*si*i*nR****r *l*ss o* t** run-ll*m*/ll*m*_in**x r*pository, ***or* v*rsion *.*.* (sp**i*i**lly in v*rsion *.**.** o* ll*m*-in**x), *llows *or **r*link-**s** p*t* tr*v*rs*l. T*is *l*w p*rmits *tt**k*rs to *yp*ss p*t* r*stri*ti

Reasoning

T** vuln*r**ility li*s in t** `lo**_**t*` m*t*o* o* t** `O*si*i*nR****r` *l*ss in t** `ll*m*-in**x-r****rs-o*si*i*n` p**k***. T** *or* o* t** issu* is * **ilur* to prop*rly s*nitiz* *n* v*li**t* *il* p*t*s, sp**i*i**lly *y not ***ountin* *or **r*link