# Federated share permissions can be increased by recipient

Federated share recipient sent a crafted RESHARE_CHANGE_PERMISSION notification to their own server, escalating a read-only share to read/write/share.

- Payout: $500
- Severity: medium
- Program: ownCloud
- Found by: rullzer
- Disclosed: 2023-06-24
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1990443
- Library page: https://bugbountylibrary.com/r/h1%3A1990443
- Tags: area:web domain:web impact:integrity impact:privesc kind:bounty platform:hackerone sev:medium tech:php vuln:access-control vuln:business-logic vuln:privilege-escalation

**Target:** ownCloud federatedfilesharing notifications endpoint
**Root cause:** The recipient-side server trusts a client-supplied RESHARE_CHANGE_PERMISSION notification containing sharedSecret and permission, applying the permission change without verifying the sender is authorized to grant it.
**Steps:**
1. userA on serverX federated-shares a file to userB on serverY (read-only default)
2. userB accepts the share
3. userB extracts SHARE_ID and SHARE_TOKEN from their own database
4. userB POSTs to `https://SERVERY/apps/federatedfilesharing/notifications` with `{"notificationType":"RESHARE_CHANGE_PERMISSION","resourceType":"file","providerId":"SHARE_ID","notification":{"sharedSecret":"SHARE_TOKEN","permission":["read","write","share"]}}`
5. userB now has full read/write/share access
**How found:** Recipient inspected the federated sharing notification flow and noticed permission changes are accepted via a client-controlled notification type using the shared secret they already possess.
**Exploitation:** Recipient controls their own server and knows the share token/id, so they forge the permission-change notification locally to grant themselves write and reshare rights on the incoming share.
**Insight:** In federated/remote-share designs, the receiving instance is attacker-controlled; any notification type that mutates permissions and is authenticated only by the shared secret (which the recipient holds) is self-grantable. Audit RESHARE_* notification handlers for sender-side authorization.

## Proof of concept (copied exactly from the original report)

**POST to federatedfilesharing notifications raising permissions**

````
https://SERVERY/apps/federatedfilesharing/notifications```

With the content. Replacing the SHARE_TOKEN, and the SHARE_ID they find in their database

{
    "notificationType": "RESHARE_CHANGE_PERMISSION",
    "resourceType": "file",
    "providerId": "SHARE_ID",
    "notification": {
        "sharedSecret": "SHARE_TOKEN",
        "permission": ["read", "write", "share"]
    }
}
````

