Skip to main content

CVE-2025-6210: Llamaindex Path Traversal Vulnerability

CVE-2025-6210 is a hardlink-based path traversal flaw in Llamaindex ObsidianReader that allows attackers to bypass security checks and access sensitive system files like /etc/passwd. This post covers technical details, affected versions, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-6210 Overview

CVE-2025-6210 is a path traversal vulnerability in the ObsidianReader class of the run-llama/llama_index repository. The flaw exists in version 0.12.27 of the Obsidian reader integration and allows local attackers to bypass directory restrictions using hardlinks. The load_data() method fails to differentiate between regular files and hardlinks, letting attackers read sensitive files such as /etc/passwd from outside the intended Obsidian vault. The issue is categorized under [CWE-22] (Improper Limitation of a Pathname to a Restricted Directory). The maintainers resolved the vulnerability in the llama-index-readers-obsidian package version 0.5.2.

Critical Impact

A local attacker who can place hardlinks inside an Obsidian vault directory can read arbitrary files from the host filesystem that the LlamaIndex process has permission to access.

Affected Products

  • run-llama/llama_index repository, affected code shipped in llama-index version 0.12.27
  • llama-index-readers-obsidian package versions prior to 0.5.2
  • Any application embedding the vulnerable ObsidianReader class to ingest Obsidian vault content

Discovery Timeline

  • 2025-07-07 - CVE-2025-6210 published to NVD
  • 2026-10-18 - Last updated in NVD database

Technical Details for CVE-2025-6210

Vulnerability Analysis

The ObsidianReader class is designed to ingest Markdown notes from a user-specified Obsidian vault directory. Its load_data() method enumerates files inside that directory and passes them to a Markdown reader for parsing. The method applies path checks intended to confine reads to the vault, but it treats hardlinks as ordinary files. On POSIX systems, a hardlink is a directory entry that references the same inode as another file, including files located outside the vault directory. Because the inode-based target is never validated, the reader opens and returns the linked file's contents. The impact is limited to confidentiality, consistent with the vulnerability's local attack vector and read-only disclosure of file contents.

Root Cause

The root cause is missing hardlink detection in the file enumeration logic. The pre-patch code checked that each path resided under the vault root but did not inspect the inode link count or compare the real path to the vault boundary. Any entry inside the vault directory whose inode is referenced by multiple names was processed, regardless of where the other names resided on disk.

Attack Vector

Exploitation requires local filesystem access to the directory that the ObsidianReader will scan. An attacker with write access to the vault creates a hardlink inside it pointing to a target file such as /etc/passwd. When a LlamaIndex application invokes ObsidianReader.load_data(), the content of the linked file is read and returned to the caller, which commonly embeds the data into an LLM context or vector store. This can leak host secrets to downstream model prompts, logs, or indexed storage.

python
# Patch: llama-index-integrations/readers/llama-index-readers-obsidian/
# llama_index/readers/obsidian/base.py
from llama_index.readers.file import MarkdownReader


def is_hardlink(filepath: Path) -> bool:
    """
    Check if a file is a hardlink by checking the number of links to/from it.

    Args:
        filepath (Path): path to the file.

    """
    stat_info = os.stat(filepath)
    return stat_info.st_nlink > 1


class ObsidianReader(BaseReader):
    """
    input_dir (str): Path to the Obsidian vault.

Source: GitHub Commit a86c96a

Detection Methods for CVE-2025-6210

Indicators of Compromise

  • Files inside an Obsidian vault with an inode link count greater than one, as reported by stat or ls -li.
  • Vault directories containing entries whose resolved inode matches sensitive system files such as /etc/passwd, /etc/shadow, or application secret stores.
  • LlamaIndex ingestion logs or vector stores containing non-Markdown content or system file fragments.

Detection Strategies

  • Audit any application invoking ObsidianReader.load_data() for the installed version of llama-index-readers-obsidian and flag versions below 0.5.2.
  • Scan configured vault paths recursively for files where st_nlink > 1 and report them for manual review.
  • Review LLM prompt and embedding storage for content patterns that resemble /etc/passwd entries or other system file formats.

Monitoring Recommendations

  • Enable filesystem auditing with auditd or equivalent on hosts running LlamaIndex to log link() and linkat() syscalls targeting vault directories.
  • Monitor process reads of sensitive files by the Python interpreter running LlamaIndex workloads.
  • Track dependency updates in CI so that pinned llama-index-readers-obsidian versions are visible to security teams.

How to Mitigate CVE-2025-6210

Immediate Actions Required

  • Upgrade llama-index-readers-obsidian to version 0.5.2 or later across all environments that import ObsidianReader.
  • Inventory Obsidian vault directories exposed to LlamaIndex ingestion and remove any hardlinks pointing outside the vault root.
  • Run LlamaIndex ingestion processes under a least-privileged account that cannot read system or application secret files.

Patch Information

The fix is delivered in llama-index-readers-obsidian version 0.5.2 via commit a86c96a. The patch introduces an is_hardlink() helper that calls os.stat() and checks st_nlink > 1, then skips any matching entries during load_data(). Additional context is available in the Huntr Bounty Report.

Workarounds

  • Pre-process vault directories to detect and remove files with st_nlink > 1 before invoking ObsidianReader.
  • Mount the vault directory on a dedicated filesystem that does not share inodes with sensitive system paths.
  • Isolate the ingestion job in a container with read-only bind mounts limited to the vault directory.
bash
# Identify hardlinks within a vault directory prior to ingestion
find /path/to/obsidian/vault -type f -links +1 -printf '%p inode=%i links=%n\n'

# Upgrade the vulnerable package to the fixed release
pip install --upgrade 'llama-index-readers-obsidian>=0.5.2'

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.