by pavel_lishin · 1y ago · 0 comments
> Gzip only provides a compression ratio of a little over 1000: If I want a file that expands to 100 GB, I’ve got to serve a 100 MB asset. Worse, when I tried it, the bots just shrugged it off, with some even coming back for more.
I thought a gzip bomb was crafted to explicitly be virtually unlimited in the "payload" size?
The problem with gzip bombs in the web context in general is that they operate on the naive assumption that the client will decompress the payload entirely. This is very rarely the case, and you kinda have to go out of your way to make that happen[1], and it really only makes sense if you're looking at some binary format that can't be truncated like you can with HTML.
Instead most if not all clients will use some form of streaming decompression, with a termination criterion, and to the extent stuff is decompressed in full, very rarely will anything be decompressed in full and held in memory, as that would nuke your crawler the first time you ran into a website mirroring linux ISOs.
[1] This is the zlib api for decompressing a gzip file: https://refspecs.linuxbase.org/LSB_3.0.0/LSB-Core-generic/LS...
It's a choice between sending them some big files that will be filtered out long before they can do any real damage or sending them nonsense text that might actually make it's way into their training data.