How to detect and avoid zip bombs with this library? #587
-
Is support already built in? Will I haven’t seen any mentions of zip bomb in this library, but I’d like to double check how to handle it. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
For example, |
Beta Was this translation helpful? Give feedback.
-
zip.js does not unzip files recursively. That already reduces the attack surface quite a bit. For example, you can open the zip file provided here: https://github.com/iamtraction/ZOD without crashing your browser with this demo: https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.html. Can you think of any other types of attack? |
Beta Was this translation helpful? Give feedback.
-
For the record, 42.zip can also be downloaded here: https://unforgettable.dk/. I've also done additional tests with the following files and they don't cause particular issues when reading them, i.e. the browser does not crash and the entries can be uncompressed safely. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the explanation and examples! Those were the ones I had in mind 👍 Though, is it still possible for a file to lie about the entry sizes? E.g. |
Beta Was this translation helpful? Give feedback.
zip.js does not unzip files recursively. That already reduces the attack surface quite a bit. For example, you can open the zip file provided here: https://github.com/iamtraction/ZOD without crashing your browser with this demo: https://gildas-lormeau.github.io/zip.js/demos/demo-read-file.html.
Can you think of any other types of attack?