# Virtual Data Room / Hide download on collabora is easy to bypass

WOPI access_token exposed in Collabora websocket URL lets anyone curl the WOPI endpoint and download the unwatermarked file despite hide-download/secure-view.

- Payout: $150
- Severity: high
- Program: Nextcloud
- Found by: rtod
- Disclosed: 2021-08-07
- CVE: CVE-2021-32748
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1194606
- Library page: https://bugbountylibrary.com/r/h1%3A1194606
- Tags: area:web domain:web impact:data-leak impact:integrity kind:bounty platform:hackerone sev:high tech:rest technique:js-analysis vuln:access-control vuln:info-disclosure

**Target:** Nextcloud richdocuments WOPI endpoint via Collabora
**Root cause:** The WOPI access_token is embedded in the client-visible websocket URL and grants full file read access; hide-download is enforced only in the UI, not at the WOPI endpoint.
**Steps:**
1. Setup Nextcloud+Collabora, enable secure view and File Access Control blocking downloads
2. Share `vdr.odt` via public link with hide download enabled
3. Open the link, filter DevTools network for `WOPISRC`
4. Extract the `wss://collabora.../ws?WOPISrc=...` URL containing `access_token=efgh` and fileid `1234_abcd`
5. Run `curl 'https://server/index.php/apps/richdocuments/wopi/files/1234_abcd?access_token=efgh' -o stolen.odt`
6. Open stolen.odt — unwatermarked original content
**How found:** Reporter inspected browser network traffic while opening a hide-download share, noticed the WOPISRC websocket URL carried the WOPI endpoint and access_token, and reasoned the token could be replayed directly against the WOPI REST endpoint.
**Exploitation:** Attacker with the public share link reads the WOPI access_token from the websocket URL in browser devtools, then directly requests the WOPI files endpoint with that token to retrieve the raw document, bypassing watermark and download restrictions.
**Insight:** When a viewer/editor is embedded via a protocol like WOPI, the client-side session URL often leaks the backend access token — replay it directly against the documented WOPI/REST file endpoint to bypass UI-only protections like watermarking or hide-download.

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

**Curl WOPI endpoint to download unwatermarked file**

```
curl https://server/index.php/apps/richdocument/wopi/files/1234_abcd?access_token=efgh -o stolen.odt
```

