LlamaIndex Uncontrolled Memory Consumption Vulnerability in SimpleDirectoryReader Component

Vulnerability

A resource management vulnerability has been identified in the SimpleDirectoryReader component of LlamaIndex, specifically in version 0.12.23. The issue arises from the improper application of user-defined file limits, which are enforced only after all files in a directory have been loaded into memory. This flaw can lead to excessive memory usage and increased CPU consumption, particularly in environments with limited resources. The vulnerability can be exploited by providing directories with a large number of files, causing memory exhaustion and degraded performance.

Impact

The vulnerability causes significant memory inefficiencies and poses a denial-of-service risk by allowing the processing of large directories to exhaust system resources, leading to unresponsiveness, especially in multi-tenant environments.

Reproduction

The vulnerability can be reproduced by creating a directory with a large number of files, such as three million empty files, and then using the SimpleDirectoryReader to process the files while setting the num_files_limit parameter to a low value, like ten. This setup will cause the memory usage to spike over one gigabyte before the limit is applied, demonstrating the uncontrolled memory consumption issue.

Remediation

Users can upgrade to LlamaIndex version 0.12.41 or later, where this vulnerability has been fixed.

Added: Feb 2, 2026, 11:18 AM
Updated: Feb 2, 2026, 11:18 AM

Vulnerability Rating

Custom Algorithm
spread
4.2
impact
2.5
exploitability
4.3
remediation
7.7
relevance
2.6
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.