user can bypass password enforcement when federated sharing is enabled
When password enforcement for link shares is enabled and federated sharing is allowed, a user can add a password-protected link share to another Nextcloud instance via 'add to your nextcloud', which creates a new link share without a password. This lets registered users bypass the admin's sharing policy, and anyone with database read access could access all federated shares.
- Triaged in 14 days
- Fixed in 2.1 years
- Paid in 2.1 years
- Disclosed after 2.2 years
If the admin forces password for link shares and federated shares are enabled, users can bypass this enforcement. Tested with Nextcloud 18.0.3
Steps to reproduce:
- enable password enforcement for link shares as admin
- as user1 create a link share with password
- open the link share in a separate browser session and enter the password
- use "add to your nextcloud" and add the file to another nextcloud or the same nextcloud with another user.
- login as user1, now there is a new link share without password protection. The gui shows that password is enforced, but the link has no password protection
- copy the new created link
Additional information: I think the problem is, that if the share is added by "add to your nextcloud", the wrong share_type is set. federated shares normally use the value 6, but the value 3 is set.
Additional problem: Users can bruteforce link-ids. okay this is something that takes a long time because of 62^15 combinations. But if a forced password is used, every try is protected by the brute-force protection. Just testing links isn't protected by the bruteforce protection I think. Maybe someone just gets read access to the database (or a backup of this). In this case all federated shares are leaked.
So, if password is forced for link shares, enabling federated shares will lower the security level.
Why is there no additional password or public/private-keypair used for establishing and accessing federated shares?
Impact
This is something that can be used by registered users to bypass the sharing policy. An attacker that gets read access to the database can access all federated shares.
Attachments

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the 'add to your nextcloud' flow sets the wrong share type (3 instead of 6 for federated shares), so the new share is treated as a normal link share and the password enforcement is not applied.
Impact
Registered users can bypass the sharing policy, and an attacker with database read access could access all federated shares.
What the attacker needed
Password enforcement for link shares enabled; federated sharing enabled; a registered user account
How it was found
- Enable password enforcement for link shares as admin.
- As user1, create a link share with a password.
- Open the link share in a separate browser session and enter the password.
- Use 'add to your nextcloud' to add the file to another Nextcloud or the same Nextcloud with another user.
- Log in as user1; a new link share without password protection now exists.
- Copy the newly created link.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A link share is a public URL that lets anyone with the link open a file. The admin can force these links to require a password. The report shows that when a user imports such a link into another Nextcloud account, the system creates a new link that skips the password requirement, so the protection is lost.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.