So there are two ways attacking some server that accepts zips.
Slip Zips (with path traversal) so u save stuff outside the zip
You upload a zip bomb which is incredible small but it huge when uncompressing https://en.wikipedia.org/wiki/Zip_bomb
So first one can be avoided by simple checks. https://snyk.io/research/zip-slip-vulnerability#java
But how to I avoid running into the second one?
Count the byte that I wrote during unzipping and if there are more then X bytes cancel?