The vulnerability exists in the pypdf library's handling of stream objects within a PDF file. Specifically, the DictionaryObject.read_from_stream function in pypdf/generic/_data_structures.py was identified as the vulnerable function. The analysis of the patch commit 3c550b3196adeba1506a26e57c09c09fac75e9aa reveals that the vulnerability is caused by unconditionally trusting the /Length attribute of a stream object. An attacker can craft a PDF with a manipulated, very large /Length value. When pypdf processes this stream, the read_from_stream function would attempt to read the specified number of bytes into memory via stream.read(length). This leads to excessive memory allocation, which can exhaust system resources and cause a denial of service. The patch mitigates this by introducing a size validation check. It compares the stream's declared length against a new constant, MAX_DECLARED_STREAM_LENGTH, and raises a LimitReachedError if the length is excessive, preventing the large memory allocation. Therefore, any runtime profile during the exploitation of this vulnerability would show DictionaryObject.read_from_stream as a key function in the stack trace leading to the memory allocation.