The vulnerability lies in the way the bugsink application handles Brotli decompression. The brotli_generator function in bugsink/streams.py was responsible for decompressing incoming data. However, it did not impose any limits on the size of the decompressed data. This allowed an attacker to send a "brotli bomb"—a small, highly compressed file that expands to a massive size—and cause the server to run out of memory, resulting in a denial of service. The fix, implemented in commit 3f65544aab3ad5303d97009136640de97b0676a5, involves two main changes. First, the Brotli library was upgraded to a version that supports an output_buffer_limit in its decompressor. Second, the brotli_generator function was modified to use this new feature, thereby chunking the decompression process and preventing uncontrolled memory allocation. The GeneratorReader.read method was also identified as part of the vulnerable execution flow, as it would be the function to trigger the large memory allocation by attempting to read the entire decompressed stream at once.