run-llama llama_index Hardlink-Based Path Traversal Vulnerability in Obsidian Reader
Vulnerability
A hardlink-based path traversal vulnerability has been identified in the ObsidianReader class of the run-llama/llama_index repository, specifically in version 0.12.27. This vulnerability allows attackers to bypass path restrictions and access sensitive system files, such as /etc/passwd, by exploiting hardlinks. The issue arises from inadequate handling of hardlinks in the load_data() method, where security checks fail to distinguish between real files and hardlinks.
Impact
Exploitation of this vulnerability could lead to unauthorized access to sensitive system files, potentially allowing for further attacks or information disclosure.
Reproduction
To reproduce this vulnerability, create a hardlink to a sensitive file, such as /etc/passwd. Then, use the ObsidianReader class in version 0.12.27 to load data. The load_data() method will not properly handle the hardlink, allowing access to the linked file despite path restrictions.
Remediation
Users can upgrade to version 0.5.2 of the llama_index repository, where this vulnerability has been addressed.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
