logoalt Hacker News

esttoday at 1:55 AM2 repliesview on HN

I wonder if similar hacks apply to zlib and .png as well.


Replies

wmftoday at 2:47 AM

Zip and PNG bombs have been around for a while: https://github.com/0x48piraj/gz-bomb https://libpng.sourceforge.io/decompression_bombs.html

show 2 replies
nneonneotoday at 2:09 AM

Probably not; for PNG, the image size is declared in the header, so a decoder can decide immediately if it wants to decode the image or not. The output is bounded by the size of the image times the bit depth, and decompression runs in time proportional to output size. zlib bombs exist, but they don't affect png because a decoder can simply refuse to decompress past the size of the pixel buffer.

show 1 reply