The vulnerability lies in the ContentStream.__init__ method in pypdf/generic/_data_structures.py. The original implementation handled array-based content streams by repeatedly concatenating byte strings using the += operator. This operation is inefficient in Python as it creates a new byte string object with each concatenation, leading to a quadratic time complexity (O(n^2)) where n is the number of streams. An attacker could craft a PDF with a content stream composed of a large array of smaller streams, causing the application to consume excessive CPU and memory, resulting in a denial of service. The patch addresses this by replacing the inefficient string concatenation with a bytearray and also introduces size and length limits (MAX_ARRAY_BASED_STREAM_OUTPUT_LENGTH and CONTENT_STREAM_ARRAY_MAX_LENGTH) to prevent resource exhaustion. The vulnerable function is clearly ContentStream.__init__ as it's where the inefficient processing occurs.