PaulLereverend / NextcloudExtract

Bring extraction to your nextcloud web interface
GNU Affero General Public License v3.0
49 stars 14 forks source link

zip-bombing vulnerability #76

Open tetsuo76 opened 2 years ago

tetsuo76 commented 2 years ago

Hello,

I've noticed that the extract app doesn't respect the user quota set on Nextcloud. I uploaded a 4MB zip which contains a 4GB text file. The Extract app completely ignores my quota set on Nextcloud (2GB) and extracts the 4GB file without any issues.

The available space of my account still remains the same until I manually scan the files of my account (occ files:scan ).

This bug is pretty serious and it can also be considered as a security risk.

rotdrop commented 1 year ago

The actual bombing could perhaps be solved by

https://github.com/selective-php/archive-bomb-scanner

However, I suppose the quota thing is inherent to the current implementation of NextcloudExtract as it somehow circumvents the Nextcloud FS API:

I would suspect the one either would need to go through the public file-system API, using file->putContent() or would have to implement the quota-check in the app (e.g. by scanning the archive beforehand and refusing to extract if the quota is exceeded)