A Zip bomb (concept here) seems quite a "smart" and easy vulnerability to websites where uploading ZIP files is allowed. Such sites are under a threat (at least to make some degree of damage to them) - someone uploads i.e. a 100 KB file [ 50 GB compressed] to your site and when your site extracts (or whoever opens that) runs out of resources, causing the consequent damages.
Antivirus software is said to detect such zip bombs by detecting the recursion depth and common patterns, but i dont ask about Windows OS or like that (where we could be protected by AV) but i speak on websites (i.e. vps or shared hosting) where we just use programming languages (I'm interested in PHP, but for other people might Java or ASP also needed).
Are there any kind of builtin solutions in PHP(etc..), which already prevents happening that? if not how can we limit that? (any code example)
How can we detect these kinds of files on our servers (without extracting them)?
Another layer of attack seems to send a request with a Gzip bomb. How can we protect against that?