nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.54k stars 4.08k forks source link

Add administrator function to disable ZIP downloads of folders #9818

Closed GoetheG closed 6 years ago

GoetheG commented 6 years ago

Hey everybody,

As a security precaution I find it important to have the administrator function to disable ZIP downloads of folders. The way I see it, the administrator should be also able to monitor who's using the ZIP function

I know, there are plenty of other ways to bypass this security function I mentioned. But this would at least avoid massive data theft by people with limited understanding for software.

Take a look at this discussion here: https://github.com/owncloud/core/issues/16370

Keep up with the good work, guys!

Yours

Phillip

c0fe commented 6 years ago

It seems like a good idea at first but then again it will do very little to stop someone with intentions to steal the information. Considering that the user would have access to simply sync this with one of their hard drives especially an external one so that they can move this out.

The idea of adding the security and some sort of measures to prevent data theft would need to be thought further and we would have to check with what options exist on a range of operating systems.

MorrisJobke commented 6 years ago

I know, there are plenty of other ways to bypass this security function I mentioned. But this would at least avoid massive data theft by people with limited understanding for software.

Security by obscurity does very rarely work. If this is your only concern, then hide the button via CSS. Because there are people out there that are able to script the one file by another approach to fetch the shared (!!!) files anyways. So this does not add any security layer at all.

Beside the other ideas: I would rather ask to implement this as an app, that hooks into the sharing page and manipulates it to not allow the download via ZIP file if wanted. It can also hook into the sharing dialog to ask for this permission.

Thus I will close this in the server repo as we will not add it to the server directly but it should be implemented as app. If you need help with implementing it we are happy to assist.

GoetheG commented 6 years ago

I think it is important to have this option. Because there are always people I cannot trust and I want to be able to deactivate this option for registered users (not for file sharing).

Is there another option with a script or with some other setting?

MorrisJobke commented 6 years ago

I think it is important to have this option. Because there are always people I cannot trust and I want to be able to deactivate this option for registered users (not for file sharing).

Just as a little side note: this is then only hiding it. Because people could share the folder and download then as zip file 🙈

GoetheG commented 6 years ago

@MorrisJobke I know, and you are absolutely right. But it’s the same with website security. You cannot build a totaly secure website. But you can make it damn hard for the user to gain access.

For non profit organisations and also for businesses it’s vital to have secure access to data. I still think that’s crucial to have the option to completely deactivate ZIP downlods. The administrator should have this option. I mean, it’s possible to forbid users to use the desktop client via the file access control app. Why does this ZIP thing seem to be that big of an issue? I don’t understand that.

I work at an university and the guys there do also have precautions to prevent data loss. They do not want that working students may download stuff they shouldn’t. Just an example.

MorrisJobke commented 6 years ago

As this sounds like a nice feature, the requests for this are quite low. Currently there a no plans to implement such a feature. Thus I will keep this ticket closed for now. This does not mean we don't want this feature, but it is simply not on our roadmap for the near future. If somebody wants to implement this feature nevertheless we are happy to assist and help out. Best would be to implement this inside an app and disable the button via this.

If you wish to have this feature implemented by the Nextcloud GmbH there is the option for consulting work on top of your Nextcloud Enterprise subscription to get your features implemented.

GoetheG commented 5 years ago

Hi @MorrisJobke. Thank you for your explanation. I absolutely understand that you cannot implement everything we ask for here. Fair enough. Is there maybe any chance that we kickoff something with little money? Maybe there is somebody who could implement that.

As a charity we cannot pay thousands of Euros. Unfortunately. So if there is some program where we could ask for that, please tell.

MorrisJobke commented 5 years ago

Hi @MorrisJobke. Thank you for your explanation. I absolutely understand that you cannot implement everything we ask for here. Fair enough. Is there maybe any chance that we kickoff something with little money? Maybe there is somebody who could implement that.

As a charity we cannot pay thousands of Euros. Unfortunately. So if there is some program where we could ask for that, please tell.

There is a section in the forums at https://help.nextcloud.com which is for exactly those requests. Maybe put it in there?

landryb commented 5 years ago

Fwiw, i had a similar need, ie disabling/neuteuring the "download" feature which might impact server workload generating huge zips with dozens of files, summing gigabytes of data - i want to push those users to use webdav clients that download files by files.

I'm no javascript nor php expert, and i dont know really well the NC architecture, but i identified 3 places, and 3 distinct ways to set a "limit" so that users wont hammer the server generating zips :


* the '3 dots' menu on the right side of a file/dir has a 'download' item too, targeting the current file/dir - here i only prevent the download if it's a dir and its size is larger than the threshold:

+++ b/apps/files/js/fileactions.js @@ -601,6 +601,10 @@

                                    var downloadFileaction = $(context.$file).find('.fileactions .action-download');
* and finally, when a dir is publicly shared, i dont want the "download all files" item at the right top, so i only add items to the menu if the size is below the limit. In that case, there's no user feedback.. `alert()` in js is ugly anyway :(

--- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -456,12 +456,14 @@ class ShareController extends AuthPublicShareController { if ($isNoneFileDropFolder && !$share->getHideDownload()) { \OCP\Util::addScript('files_sharing', 'public_note'); if ($shareIsFolder) {


The 3 snippets are against `stable15` git branch, and i've lightly tested them - maybe there are more spots allowing to call `ajax/download.php` but those were the most visible ones i found.

This is of course hacks, and definitely not something worth of a pull request, but if it can be useful to someone to properly integrate it in NC (i really dont see how this could be integrated as a proper app; but i really dont know nextcloud code nor have the time to dig into it...), or to use it on its own instance, that's good :)
Nottt commented 5 years ago

It would be nice to be able to disable this...not because of security...but because of speed/performance.

It is faster to let the client do 10 simultaneous downloads than zipping a folder and delivering in 1 download

insanemal commented 4 years ago

I'm just putting this out there but I use my owncloud to move multiple, multi-gb video files around.

The download all button always ends up eating everything..

Please let us disable it.

mackonsti commented 2 years ago

Hello everyone, apologies to revive this old ticket, I have a couple of questions:

a) is this feature eventually implemented? The ticket was opened 2+ years ago, and I cannot see an option on NextCloud server 22.2.3 etc.

b) do you know where is stored (i.e. the path of) the temp folder where ZIPs are created before being downloaded to the (remote) user? Would a server reboot clean up these? I am using a rather small boot/system partition (OpenMediaVault 5.x) and I am afraid this zipping action would just fill up the remaining GBs of space used by the system itself...

Thank you all.

insanemal commented 2 years ago

Why is this closed? This feature is broken. This isn't a "Nice to have". This is a joke.

If you use download ZIP on large downloads it just fails. Scribbles crap everywhere and fails. There NEEDS to be an option to disable it.

landryb commented 8 months ago

note for the ppl interested in this 'feature' (see commits above in my own branch, eg https://github.com/nextcloud/server/compare/stable28...landryb:server:stable28+download_limit), upgrading my current install from 23 to 28, i've figured out that there are new different places to modify: