CVE-2025-6208: llama-index-core vulnerable to Uncontrolled Resource Consumption
llama-index-core before 0.12.41 applies the num_files_limit setting of SimpleDirectoryReader only after it has gathered every file in the directory. A directory with very many files can exhaust memory and slow or stop the application, even when a small limit was set. Fixed in 0.12.41.
Published Feb 2, 2026 · Analysis Nov 1, 2026
What an attacker can do
SimpleDirectoryReader lets a developer cap the number of documents with num_files_limit. In affected versions the cap was applied late. The advisory says all files in the directory were loaded before the limit took effect. The fix commit shows the same ordering problem in _add_files() in llama_index/core/readers/file/base.py: it called self.fs.glob() to collect every matching file, filtered, then sliced the list to the limit.
The cost scales with the number of files, not with the limit. An attacker who can put many files into a directory that the application ingests, for example through an upload feature, a shared folder, a synced drive or an extracted archive, can make each ingestion consume memory and time out of proportion to the setting. The CVSS 3.0 vector reflects that: network reachable, no privileges, availability impact only, rated low.
There is no data exposure or code execution. The risk is a degraded or crashed ingestion service, worst in small containers and serverless jobs with tight memory limits.
Who is affected
llama-index-core versions below 0.12.41; the advisory names 0.12.23 specifically. The code path is SimpleDirectoryReader used with num_files_limit on a directory whose contents an outsider can influence. Check the installed version:
pip show llama-index-coreThen search your code for SimpleDirectoryReader and num_files_limit.
llama-index-core
- Ecosystem
- PyPI
- Affected
- < 0.12.41
- Fixed in
- 0.12.41
- Check
pip show llama-index-core
How to fix it
Upgrade to llama-index-core 0.12.41.
pip install --upgrade "llama-index-core>=0.12.41"The fix replaces the full glob with self.fs.walk() in _add_files(), counts files as it goes and stops once the limit is exceeded. The sources give no other workaround. Until you upgrade, avoid pointing SimpleDirectoryReader at directories that untrusted parties can fill, or cap the number of files before they reach the directory.
How to tell if you were hit
Look for ingestion jobs whose memory or run time grows with directory size, out-of-memory kills in the container or job logs, and directories read by SimpleDirectoryReader that contain unusually large numbers of small files. Compare the file count in the source directory with the num_files_limit you configured. The sources give no specific log line.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
The SimpleDirectoryReader component in llama_index.core version 0.12.23 suffers from uncontrolled memory consumption due to a resource management flaw. The vulnerability arises because the user-specified file limit (num_files_limit) is applied after all files in a directory are loaded into memory. This can lead to memory exhaustion and degraded performance, particularly in environments with limited resources. The issue is resolved in version 0.12.41.
Questions
- Does CVE-2025-6208 allow code execution?
No. It is an uncontrolled resource consumption flaw with low availability impact. It does not expose data or run code.
- Does setting num_files_limit protect me on older versions?
No. That setting is the problem. In affected versions it was applied only after the files in the directory had been collected.
- Which version fixes it?
llama-index-core 0.12.41 fixes it. All earlier versions are listed as vulnerable, including 0.12.23, which the advisory names.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LlamaIndex vulnerabilities
All LlamaIndex entriesCVE-2025-7707
llama-index has Insecure Temporary File
high7.1Oct 13, 2025CVE-2025-7647
llama-index-core insecurely handles temporary files
high7.3Sep 27, 2025CVE-2025-5302
LlamaIndex affected by a Denial of Service (DOS) in JSONReader
high8.6Aug 26, 2025CVE-2025-6211
LlamaIndex vulnerable to data loss through hash collisions in its DocugamiReader class
medium6.5Jul 10, 2025CVE-2025-3108
LlamaIndex has Incomplete Documentation of Program Execution related to JsonPickleSerializer component
medium5.0Jul 7, 2025CVE-2025-5472
LlamaIndex vulnerable to DoS attack through uncontrolled recursive JSON parsing
medium6.5Jul 7, 2025
