Circle email-members have still access to a shared folder/file after they are removed from the circle
- Triaged in 6 days
- Fixed in 3 months
- Paid in 6 months
- Disclosed after 7 months
If a email-address is added to a circle, the email user has still access after the email-address is removed from the circle. Requirements
circles app and share by mail app enabled
Steps to reproduce
- add an email address to a circle
- share a folder/file with the circle
- remove the email address from the circle
- try to access the link that is sent to the email address
email user has still access!
Additional information
For every circle share is a non user specific link token created. this token is sent to the email-members. An other problem is, that if you have forced password usage for link shares and share by mail shares, this link is still accessible without a password.
Tested with: Nextcloud 15.0.10 Circles 0.16.9 share by mail 1.5.0
Impact
A email-member that is removed from a circle
What the report shows
This is a low severity access control bug in Nextcloud, reported through HackerOne and disclosed on 1 March 2020. The affected asset is nextcloud/server, and the weakness is classified as improper access control. The researcher, michag86, received a bounty of 200 USD. The CVSS score recorded is 2.0.
The feature under test is the Circles app combined with the share by mail app. A circle is a group of members; members can be user accounts or email addresses. When a folder or file is shared with a circle, the share reaches every member, including the email-only ones.
The researcher's claim is simple: if an email address is added to a circle, the person behind that address keeps access after the address is removed from the circle.
Requirements
The report states two prerequisites: the circles app and the share by mail app must be enabled.
Steps to reproduce
- Add an email address to a circle.
- Share a folder or file with the circle.
- Remove the email address from the circle.
- Try to access the link that was sent to the email address.
The result, in the researcher's words, is that the email user still has access.
Additional information
The report explains the mechanism it observed: for every circle share, a non user specific link token is created, and this token is sent to the email members. The report notes that the token is not specific to a user, and that the email user still has access after removal.
The researcher notes a second problem in the same area. If forced password usage is configured for link shares and for share by mail shares, the link sent to the email member is still accessible without a password.
Tested versions
The report lists the versions used:
| Component | Version |
|---|---|
| Nextcloud | 15.0.10 |
| Circles | 0.16.9 |
| share by mail | 1.5.0 |
Impact as stated
The impact section names one affected party: an email member that is removed from a circle. The report does not describe any further consequence, and it does not include a fix, a patch reference or a timeline.
Root cause
The report points to the design of circle shares: each share gets a link token that is not specific to a user, and that token is what email members receive. Access is therefore granted by possession of the token rather than by current membership. When the email address is removed from the circle, the membership record changes but the token stays valid, so the link keeps working. The same link is also accessible without a password when forced password usage is configured for link and mail shares.
Impact
The affected party is an email member that is removed from a circle. The report also notes that the link is accessible without a password when forced password usage is configured.
How this kind of bug works
This is a stale authorisation bug. Access to a resource is represented by a bearer credential, here a link token, and the system checks the credential but not whether the subject is still entitled to it. Revocation changes the membership or permission record, but the credential lives in a separate store and is never invalidated. The result is that the permission check and the revocation path disagree about the same resource.
The same pattern appears whenever a share, invite or API key is issued to an identity that can later be removed: group shares, guest accounts, external collaborators, calendar and file shares, and invitation links. It is more likely when the credential is described as non user specific, because nothing links the token back to a member record that could be checked on each request.
How to test for it
- Identify features that issue a link or token to an identity that can be removed: group or circle shares, guest invitations, external user shares, mail shares.
- Create the identity, add it to the group, and share a resource with the group. Capture the link or token that the identity receives.
- Confirm the link works while the identity is a member.
- Remove the identity from the group through the normal administrative path.
- Replay the captured link, with the same session or with none, and see whether the resource is still served.
- Repeat with any password or expiry policy enabled, to see whether the policy is enforced on this path.
A positive result is a successful response containing the shared content after removal, ideally with a clear before and after pair of responses. Common false positives: the resource was also shared directly with the identity; a browser cache or an already open session served the content; the removal did not actually complete; or the link had expired for unrelated reasons and the test was inconclusive. Check the membership state from a second account before concluding.
How it is fixed
Where tokens cannot be revoked, shortening their lifetime limits the window.
Hunting notes
These bugs hide in collaboration and sharing features: group shares, guest and external accounts, invitation flows, and anything that mails a link. Recon signals include features that describe shares as public or non user specific, settings for forced passwords on link shares, and admin options for removing members from groups. To get a report accepted, show the exact steps, the state before and after removal, and the response proving access after revocation. Note the versions tested and whether a password policy was enabled, since that strengthens the second issue.
What happened, in plain words
This is a report about Nextcloud, a piece of software that lets people store files on a server and share them with others. The report was sent through HackerOne, a platform where people report security problems to companies, and it was made public on 1 March 2020. The researcher is michag86, the severity is low, the recorded CVSS score is 2.0, and the bounty paid was 200 USD. The affected part of the project is nextcloud/server, and the weakness is classified as improper access control.
Two optional features have to be switched on for the problem to appear: the Circles app and the share by mail app. A circle is simply a group of members. A member can be a normal user account, or it can be just an email address. When someone shares a folder or file with a circle, everyone in that circle is supposed to get access, including the people who only joined through an email address.
The claim is short: if an email address is added to a circle, the person behind that address keeps access even after the address is removed from the circle. The researcher reports that the email user still has access after removal.
Requirements
The report lists two prerequisites: the circles app and the share by mail app must be enabled. Without them the feature does not exist, so the bug cannot be triggered.
Steps to reproduce
- Add an email address to a circle. This makes the address a member, so it is meant to receive whatever the circle receives.
- Share a folder or file with the circle. A link token for the share is sent to the email members.
- Remove the email address from the circle. This is the revocation step: the person should lose access at this point.
- Try to access the link that was sent to the email address. If the link still opens the shared item, the removal did not really take effect.
The researcher did exactly this and reports that the email user still has access.
Additional information
The report explains the mechanism behind the result. For every circle share, a link token is created that is not specific to a user, and this token is sent to the email members. A token here is a long, hard-to-guess string inside a web address that acts as the key to the share: whoever holds the link holds the key. The report notes the token is not specific to a user, and that the email user still has access after removal.
The researcher also notes a second problem in the same area. Forced password usage can be configured for link shares and share by mail shares. The link sent to the email member is still accessible without a password, so that setting gives no protection on this path.
Tested versions
The report lists the versions used:
| Component | Version |
|---|---|
| Nextcloud | 15.0.10 |
| Circles | 0.16.9 |
| share by mail | 1.5.0 |
Impact as stated
The impact section names one affected party: an email member that is removed from a circle. The report does not describe any further consequence, and it gives no fix, patch reference or timeline.
In general, how this kind of bug works
This is a stale authorisation bug. Authorisation is the check that decides whether a person is allowed to do something. Stale means the decision was made once and never revisited.
A useful comparison is a hotel key card. The card opens your room because the door checks the card, not your face. If you check out and the front desk forgets to cancel the card, the card still opens the door. Here the link token is the key card, and removing the email address from the circle is the checkout. The system cancels the membership but never cancels the key.
The pattern appears whenever a share, invitation or API key is handed to an identity that can later be removed: group shares, guest accounts, external collaborators, calendar and file shares, and invitation links. It is more likely when the credential is described as not specific to a user, because nothing links the token back to a member record that could be checked on every request.
A password requirement must be enforced at the moment the token is redeemed, not only when the share is created.
How to test for it
- Find features that issue a link or token to an identity that can be removed: group or circle shares, guest invitations, external user shares, mail shares.
- Create the identity, add it to the group, and share a resource with the group. Save the link or token the identity receives.
- Confirm the link works while the identity is still a member.
- Remove the identity from the group through the normal administrative path.
- Open the saved link again, with the same session or with none, and see whether the resource is still served.
- Repeat with any password or expiry policy enabled, to see whether the policy is enforced on this path.
A positive result is a successful response containing the shared content after removal, ideally with a clear before and after pair of responses. Common false positives: the resource was also shared directly with the identity; a browser cache or an already open session served the content; the removal did not actually complete; or the link had expired for unrelated reasons and the test proved nothing. Check the membership state from a second account before concluding.
How it is fixed
Where tokens cannot be revoked, shortening their lifetime limits the window.
Hunting notes
These bugs hide in collaboration and sharing features: group shares, guest and external accounts, invitation flows, and anything that mails a link. Signals worth watching include features that describe shares as public or not specific to a user, settings for forced passwords on link shares, and admin options for removing members from groups. To get a report accepted, show the exact steps, the state before and after removal, and the response proving access after revocation. Note the versions tested and whether a password policy was enabled, since that strengthens the second issue.
Glossary
- Access control: the rules that decide who may see or change a resource.
- Authorisation: the check that a specific person is allowed to perform a specific action.
- Bounty: money a company pays a researcher for a valid security report.
- Circle: a group of members in Nextcloud; members can be user accounts or email addresses.
- Cookie: a small piece of data a website stores in your browser to remember who you are between requests.
- Credential: anything that proves identity or grants access, such as a password, a session cookie or a link token.
- CVSS: a standard scoring system that rates the severity of a security flaw, here 2.0.
- False positive: a test result that looks like a bug but is caused by something else.
- HackerOne: a platform where researchers report vulnerabilities to companies.
- Improper access control: a weakness where the system lets someone do something the rules should have prevented.
- Link token: a long, hard-to-guess string in a web address that acts as the key to a share.
- Nextcloud: software for storing and sharing files on a server.
- Regression test: an automated test that checks a fixed bug stays fixed.
- Revocation: cancelling access that was previously granted.
- Session: the period during which a website remembers you as logged in.
- Severity: how serious a flaw is judged to be, here low.
- Share by mail: a Nextcloud app that shares items with people by sending them a link by email.
- Stale authorisation: an access decision that was made once and never re-checked, so it survives a change in permissions.
- Token: see link token; a value that stands in for a permission or identity.
- Vulnerability: a flaw in software that someone can use to break the rules the software is meant to enforce.