I am trying to handle user-uploaded zip files in a Node.js web service. However, there are some situations where things can go wrong:
- The user uploads a zip file that contains symbolic links
- The zip file contains a file that is too big
For situation 1, I can check for symbolic links after unzipping, but this solution is a black-list approach. Is there a better solution?
For situation 2, I can check the unzipped size before unzipping, but this field could be arbitrarily modified and cannot be checked to prevent bad users.
So is there a more general solution to this?