Simple, limited but effective (I think). Need to ensure that average users don’t hit it though.
So it turns out ZIP compression is really good with repetitive data so if you have a really huge text file which consists of repetitive data like all zeroes, it will compress it really good. Like REALLY good.
As 42.zip shows us it can compress a 4.5 peta byte (4.500.000 giga bytes) file down to 42 kilo bytes. When you try to actually look at the content (extract or decompress it) then you’ll most likely run out of disk space or RAM.
How to defend your website with ZIP bombs : https://blog.haschek.at/2017/how-to-defend-your-website-with-zip-bombs.html