# user can bypass password enforcement when federated sharing is enabled

Federated 'add to your nextcloud' flow creates link shares with share_type 3 instead of 6, bypassing admin-enforced password policy on link shares.

- Payout: $250
- Severity: medium
- Program: Nextcloud
- Found by: michag86
- Disclosed: 2022-06-01
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/838510
- Library page: https://bugbountylibrary.com/r/h1%3A838510
- Tags: area:web domain:web impact:data-leak impact:integrity kind:bounty platform:hackerone sev:medium tech:php vuln:access-control vuln:business-logic

**Target:** Nextcloud federated sharing / link share creation endpoint
**Root cause:** When a file is added via 'add to your nextcloud', the created share is stored with share_type 3 (link) instead of 6 (federated), so the password-enforcement policy for link shares is not applied.
**Steps:**
1. Admin enables password enforcement for link shares and federated sharing.
2. user1 creates a password-protected link share.
3. In a separate session, open the link, enter password, click 'add to your nextcloud' to add to another account.
4. Login as user1: a new link share exists without password despite GUI showing enforcement.
5. Copy the new unprotected link.
**How found:** Reporter noticed the GUI claimed password enforcement while the newly created share had none, then hypothesized the wrong share_type (3 vs 6) was set during the 'add to your nextcloud' flow.
**Exploitation:** A registered user abuses the federated add flow to mint a passwordless link share, circumventing the admin sharing policy; anyone with the link (or DB read access) can access the file.
**Escalation:** DB read access would expose all federated shares since link-id brute force is not rate-limited like password attempts.
**Insight:** When a policy is enforced per share_type, test alternate creation paths (federation, re-share, import) that may write a different share_type and skip the policy check; compare stored type against expected.

