The vulnerability lies in the SimpleDirectoryReader class, specifically within the _add_files method. The description of the vulnerability states that the file limit is applied after all files in a directory are loaded into memory. The provided commit patch confirms this. The patch modifies the _add_files method in llama-index-core/llama_index/core/readers/file/base.py. Previously, the method used self.fs.glob to get a list of all files and then sliced the list to apply the num_files_limit. This is inefficient and causes the described memory issue. The fix replaces this logic with self.fs.walk and a counter to stop adding files once the limit is reached, effectively applying the limit during the file discovery process rather than after. Therefore, the SimpleDirectoryReader._add_files function is the precise location of the vulnerability, and it would appear in a runtime profile when the vulnerability is triggered by instantiating SimpleDirectoryReader with a path to a directory containing a large number of files.