nextcloud / nextcloud/groupfolders
Not possible to give groups share and write to a whole group folder and delete permissions to only specific subfolders without security problem
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 343
- Forks
- 106
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 34
Description
If i gave the group "users" rights to only share and write to a group folder and then want to give a user in that group via advanced permissions the right to delete in a specific subfolder like /a/b/c, then the user can still not delete (and hence not move or rename, as that for some weird reason seems to be tied to delete) any files in there, as the group rights with no deleting overwrite the specific user right with yes for deleting.
So my only option is to allow deleting in general for that whole groupfolder to the group and then prohibit the group from deleting everywhere via advanced permissions and then add on top the permission for that specific user. That on the other hand, makes all users of that group able to delete any files out of the trashbin, even those deleted in folders they do not have delete access to and even then when they do not have delete access on any folder. Extremely big security issue.
Steps to reproduce
Create groupfolder "test" and group "test"
Give test access to that group folder and make it have write and share, but not delete permissions
Via advanced permissions give user "test" the permission to delete for subfolder /a/b/c
Try to delete something in that folder -> Be presented with "permission denied"
Workaround:
Create groupfolder "test" and group "test"
Give test access to that group folder and make it have write, share and delete permissions.
Via advanced permissions take the delete permission from group test on the main group folder with inheritance.
Via advanced permissions give user "test" the permission to delete for subfolder /a/b/c
Try to delete something in that folder -> Works for user test, but not for any other users in group test, as intended.
BUT: All users of group test can now delete stuff from the trashbin, even if they have no delete permissions ANYWHERE.
=> Big security issue resulting, as people can now delete stuff they should absolutely not be able to, leading to possible permanent data loss
Expected behaviour
Being able to give the group users rights to share and write to a group folder plus deletion permissions in specific subfolders only without them being able to delete everything in the trash bin, even stuff they do not have access to, which will result in accidential data loss when many unexperienced users use the software.
Actual behaviour
Not being able to do that, but either people being unable to delete files or being able to delete everything out of the trashbin, even stuff they should have no access to delete.
Server configuration
Operating system: Ubuntu 20.04 LTS
Web server: Apache 2.4.41
Database: MariaDB 10.3.31
PHP version: 8.0.12
Nextcloud version: 22.2.3
Group folders version:
Updated from an older Nextcloud/ownCloud or fresh install: Fresh install
Where did you install Nextcloud from: Official page "Download for server"
Are you using external storage, if yes which one: No
Are you using encryption: No
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Google Chrome, Edge, Firefox
Operating system: Windows 11
Logs
Shouldn't be relevant for this issue. If specific ones are needed I provide them on demand.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name a file, test, or entry point. Start by reproducing the two permission configurations on Nextcloud 22.2.3 with Groupfolders, then trace how group and user delete permissions are evaluated for subfolders and the trash bin. Done means a user can delete only in the explicitly permitted subfolder, while other group members cannot delete unrelated trash-bin content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authorization, backend, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100