Skip to content
Access control Disclosed report Intermediate CVE-2021-32748

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

The 'hide download' and Secure View features in Nextcloud with Collabora do not prevent downloading the original file. An attacker who opens a shared link can read the WOPI access token from the browser's network traffic and use it to fetch the unwatermarked document directly.

rtod Follow

Originally disclosed on HackerOne

Bounty$150 High 7.7 View original
  • Triaged in 5 days
  • Fixed in 56 days
  • Paid in 56 days
  • Disclosed after 3 months

So, let me start with saying I'm not sure if this is a security issue or if it is by design. The reason I'm reporting it here is since Nextcloud promotes this Virtual Data Room a lot.

https://nextcloud.com/blog/nextcloud-announces-virtual-data-room-solution-for-ultimate-protection-of-data-during-sensitive-dealmaking/ https://nextcloud.com/virtual-data-room/

And let me just quote: "configure Secure View ensure the users can still read and (when shared with editing rights) modify documents, while the documents are watermarked when on screen."

"With secure view, our online office solutions can be configured to open PDF files, images and text files, making these files available in a watermark-protected way, while downloads and other apps are disabled using File Access Control. This setup is useful when data has to be protected from leaking but still has to be made available for review, as in a virtual data room scenario."

Both of these claims are false.

Minimal proof of concept.

  1. Setup Nextcloud with Collabora
  2. Setup sercure view & file access control to disallow the download of the files
  3. Share a document, lets say vdr.odt by public link and mark as hide download
  4. Copy the link

Now the point here is that anybody you send the link will only see the watermarked file. Not being able to download or copy data. And of course making a picture of these things is useless as it shows the watermark.

  1. attacker opens their network tab in the developer tools
  2. attacker opens the link
  3. attacker filters on WOPISRC
  4. Attacker finds a link like
wss://collabora.server/https%3A%2F%2Fserver%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1234_abcd%3Faccess_token%3efgh%26access_token_ttl%3D0/ws?WOPISrc=https%3A%2F%2Fserver%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F1234_abcd&compat=/ws

As far as I understand the WOPI spec this is us sending the collabora server the WOPI endpoint they have to call. Which in this case is

https://server/index.php/apps/richdocument/wopi/files/1234_abcd The 1234_abcd seems to be the fileid and the instance id

And the access token is also there in the url. In this case efgh.

Now if an attacker just does the following curl command

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

You will see that they have the unwatermarked version of the data. This is even easier than copying everything over or making photographs.

Impact

Your Virtual Data Room is inherently broken. And the claims you make on your website are at best misleading. However as said I'm not sure if this may be intentional as the feature is called hide download in the UI.

In any case. Maybe a good idea would be to have a secret configured on both collabora and the Nextcloud host. Which gets send. So that in case of hide download a client that doesn't know the secret token can't download the file.

I do not have access to a setup with Only Office. But I believe that to be vulnerable to a similar attack.

The original report as published on HackerOne, by rtod. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 WOPI access token is exposed to the client and grants direct download access to the file, so the 'hide download' restriction is only enforced in the user interface.

Impact

An attacker with the shared link can download the unwatermarked original document, so the Virtual Data Room protection is broken; the author notes the feature may be intentional and that OnlyOffice may be similarly affected.

What the attacker needed

Nextcloud with Collabora; Secure View and File Access Control enabled; A public share link with hide download

The fix

A secret shared between Collabora and the Nextcloud host should be required so that a client without it cannot download the file when hide download is enabled.

How it was found

  1. Set up Nextcloud with Collabora.
  2. Enable Secure View and File Access Control to disallow downloads.
  3. Share a document by public link and mark it as hide download.
  4. Open the link with the browser's network tab open.
  5. Filter the network requests on WOPISRC to find the WebSocket URL.
  6. Extract the WOPI endpoint and access token from that URL.

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.

Nextcloud is a file-sharing service, and Collabora is an online document editor. The 'hide download' option is meant to stop people saving a copy, but the editor still needs a secret pass (an access token) to fetch the file, and that pass is visible in the browser's network tab. Anyone who can open the link can copy the pass and download the original file without the watermark.

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.

More by rtod

View all

33 more disclosed reports, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.