Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity Stream doesn't seem to respect advanced permissions #1057

Open
crazy-daddy opened this issue Sep 27, 2020 · 27 comments
Open

Activity Stream doesn't seem to respect advanced permissions #1057

crazy-daddy opened this issue Sep 27, 2020 · 27 comments
Labels
1. to develop Issues that are ready for development bug feature: acl Items related to the groupfolders ACL or "Advanced Permissions" feature: activity and notification Items related to the activity and notification features of NC high high priority integration security Items that address a security vulnerability

Comments

@crazy-daddy
Copy link

With activity_use_cached_mountpoints -> true the Activity stream shows a lot of changes/uploads/etc. for files the user doesn't have permission to see, as those permissions are denied via "advanced permissions".
Could it be, that those are not correctly respected?

@thomasgg23
Copy link

Had a similar issue, try to logout and login again (even the other users have to).

See (https://docs.nextcloud.com/server/19/admin_manual/configuration_server/activity_configuration.html?highlight=groupfolders)

This config option comes with the following limitations:

  • Users that had access to a groupfolder, share or external storage can see activities in their stream and emails that happen after they are removed until they login again
  • Users that are newly added to a groupfolder, share or external storage can not see activities in their stream nor emails that happen after they are added until they login again

@sambila

This comment has been minimized.

@jeltevdw
Copy link

With activity_use_cached_mountpoints -> true the Activity stream shows a lot of changes/uploads/etc. for files the user doesn't have permission to see, as those permissions are denied via "advanced permissions".
Could it be, that those are not correctly respected?

I'll see the same behaviour. Activity logs are seen by users not having access to those files. Using advanced permissions in my case.

@thomasgg23
Copy link

To clarify we are not using the advanced permissions.
We have another use case and are only using group permissions and multiple groupfolders with nesting structures.

So it seems this is an issue with the advanced permissions settings.

@darknazz
Copy link

darknazz commented Feb 1, 2021

we got the same issue via "advanced permissions". All users receive the notification E-Mail even if the got no access to a folder in a group folder.

hope this will be implemented soon.

@Tomtiger66
Copy link

I have the same issue. Our users receive activity notifications even if they haven't access to a file or folder.

@pierreozoux pierreozoux added 0. Needs triage Issues that need to be triaged feature: acl Items related to the groupfolders ACL or "Advanced Permissions" bug integration labels Mar 13, 2021
@fschrempf
Copy link
Contributor

It looks like this has the potential to leak sensitive data. I will therefore mark this as security issue and raise the priority.

@fschrempf fschrempf added high high priority security Items that address a security vulnerability labels Mar 19, 2021
@fschrempf fschrempf added 1. to develop Issues that are ready for development and removed 0. Needs triage Issues that need to be triaged labels Apr 30, 2021
@thomasgg23
Copy link

we got the same issue via "advanced permissions". All users receive the notification E-Mail even if the got no access to a folder in a group folder.

hope this will be implemented soon.

Can confirm this too.
We had tested the "advanced permissions" in group folders and all users receive notifications even for files they have no access to like @Tomtiger66 said.

Tested with nextcloud 20.0.11 and groupfolders 8.2.2

@fschrempf
Copy link
Contributor

@icewind1991 @juliushaertl This seems to be a pretty serious thing from my point of view. Any chances that this will be handled with high priority or any other devs that should be notified?

@darknazz
Copy link

@fschrempf @icewind1991 @juliushaertl is there any new information about this ?

@fschrempf fschrempf added the feature: activity and notification Items related to the activity and notification features of NC label Nov 10, 2021
@fschrempf
Copy link
Contributor

@nextcloud/security

@fschrempf
Copy link
Contributor

fschrempf commented Jan 4, 2022

I had a closer look at the code and the obvious problem is that we use the filesystem mounts to get the users which should be notified.

This approach has already been disabled by default because of other issues (see nextcloud/activity#190) and it looks more like a hack than a proper solution.

Without an interface to query the permissions from the groupfolders app or implementing a hook to get the users that have at least read permissions, there's currently no easy way to fix this.

If anyone could help with a rough idea of a proper solution I could try to implement it at some point. Currently I don't really have an idea how it should look like.

@stekaa
Copy link

stekaa commented Feb 1, 2022

Is it at least possible the add this fact to documentation?
We just noticed this problem too. And it would have been better to know beforehand.

fschrempf added a commit to nextcloud/documentation that referenced this issue Feb 18, 2022
This extends the warning about activities in groufolders to mention the potential of
leaking sensitive data if "Advanced Permissions" are used.
See nextcloud/groupfolders#1057 for more information.
fschrempf added a commit to nextcloud/documentation that referenced this issue Feb 18, 2022
This extends the warning about activities in groufolders to mention the potential of
leaking sensitive data if "Advanced Permissions" are used.
See nextcloud/groupfolders#1057 for more information.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
@fschrempf
Copy link
Contributor

Is it at least possible the add this fact to documentation? We just noticed this problem too. And it would have been better to know beforehand.

Indeed, here is a PR for extending the documentation: nextcloud/documentation#8047.

@fschrempf
Copy link
Contributor

@zachrybaker
Copy link

IMO This is a serious issue, and the documentation is too late b/c many won't notice it until too late.

IMO this should not be a featured app, at all, until this glaring security issue is addressed.

@fschrempf
Copy link
Contributor

IMO This is a serious issue, and the documentation is too late b/c many won't notice it until too late.

IMO this should not be a featured app, at all, until this glaring security issue is addressed.

The security issue only exists if you enable activity_use_cached_mountpoints and if you do that you have probably looked at the documentation and seen the note there.

@deeeeeebs
Copy link

Wishful would be the possibility to configure some knobs from the admin side settings, which subactivites users/groups are allowed to see and not. Users should only see their own activites and commonly shared files/docs. Is that possible by just disabling ACL or the above mentioned mountpoints or do I need to manually modify some config/php file?

I would personally prefer having the possibility to disable some of the options permanently since having too many options to click on will just be confusing and unnecessary for the simple user that just need very basic information.

@ArtificialOwl
Copy link
Member

This can be closed since nextcloud/activity#992

@macrec-danielvanderwal
Copy link

Thanks @ArtificialOwl ArtificialOwl for pointing to the merge request.

Do I understand correctly that as of now (Nextcloud 25.x) the Activity app does not leak sensitive Information anymore when the configuration flag activity_use_cached_mountpoints=true is set? Point 2. and 3. still need to be resolve right..?

@ingetics
Copy link

Sorry, but I think that it still is not working.
Users groups with no permissions , receive notifications.

Environment:
-. Groups nested.
-.advanced permissions activated.
-.activity_use_cached_mountpoints=true
-. Version 25.0.3

@ArtificialOwl
Copy link
Member

@ingetics Can you provide more details so I can try to reproduce the issue locally ?

@ingetics
Copy link

Yes, of course. In fact, we have desastivacted the advanced permissions for this reason.
We have a root folder with several usergroups, some of them with reading permissions and someones with read and writing permissions in that folder.
example:

Folder A with child B and C

User Group BB
User Group CC

BB and CC read permissions on Folder A
BB read and write permissions on Folder B but NOTHING on Folder C
CC read and write permissions on Folder C but NOTHING on Folder B

If I make a change in Folder C, the people that is inside of the group BB receive a notification.
It's true that people receive the activitity notification push on the link, he can not open the file, for example, but they see the name of the file or folder created, deleted.etc.
Thanks for your attention

@jeltevdw
Copy link

I initially had the same observation that it was not working. Users with no access to specific files according to the advanced permissions still saw notifications for these files.
However when I looked at the code I was a bit confused after reading this specific line:
if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) {

This seems to suggest that it actually should be set to 'false'.

Since I changed the config "activity_use_cached_mountpoints" from true to false the behavior seems to work as expected.
In my case I have Group folders with advanced permissions and only people with access do see activities for the files they have access to.

I did change the configuration a few days ago in a production system and did several reviews of the database table oc_activity to look for unexpected usernames in the 'affecteduser' column. So far it seems to work as expected, no activity logs are created for users without access to certain files.

@fschrempf
Copy link
Contributor

This seems to suggest that it actually should be set to 'false'.

No, this line checks if activity_use_cached_mountpoints is enabled or not (true/false). If it is not set, then it returns the default value from the second parameter of getSystemValueBool which is false in this case.

Effectively this means. that only if activity_use_cached_mountpoints is explicitly enabled in the settings the groupfolder users are taken into account when the activities are created.

Otherwise there are no activities for users from groupfolders at all. At least that's the theory.

@delacosta456
Copy link

hi
@ingetics and @jeltevdw
Unless i am wrong but it' looks like this is related to NC25.x this was the case for me too and as soon as i moved to NC26.X
activity_use_cached_mountpoints => true worked as expected

@scharnkn
Copy link

scharnkn commented Oct 4, 2023

Upgrading to NC26.x also seems to have resolved the issue for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Issues that are ready for development bug feature: acl Items related to the groupfolders ACL or "Advanced Permissions" feature: activity and notification Items related to the activity and notification features of NC high high priority integration security Items that address a security vulnerability
Projects
None yet
Development

No branches or pull requests