Skip to content
Access control Disclosed report Beginner CVE-2020-8119

File-drop content is visible through the gallery app

A file-drop share that was meant to be upload-only could be viewed through the gallery app by reusing the share token in a gallery URL. Anyone with the share link could see and download the uploaded media, even when download was hidden.

nursoda Follow

Originally disclosed on HackerOne

Medium 5.0 View original
  • Triaged in 9 hours
  • Fixed in 15 hours
  • Paid in 9 hours
  • Disclosed after 3 months

I set up a file-drop on NC 17 (btw, according to https://nextcloud.com/security/ NC17 is not covered - but it should be once it's released!): created folder, set share as upload-only. I access that folder as https://cloud.domain.com/s/randompath - fine: I get the upload interface and cannot see what's in the folder. I (or anyone else) upload(s) something. Still fine. Now I use https://cloud.domain.com/apps/gallery/s/randompath and see everything that gallery can display. In my case, it was an upload folder for pictures, so everything is displayed (and can be downloaded, even if I set "hide download"!).

Impact

Access all media files uploaded to a (not so secure) file-drop (https://nextcloud.com/file-drop/) folder. Could be critical in, say, a hospital, police, etc.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is the Nextcloud gallery app, reached through the /apps/gallery/ path on a Nextcloud 17 instance. The researcher set up a file-drop share: they created a folder, configured the share as upload-only, and confirmed that the normal share URL behaved as intended.

  1. The folder was shared as upload-only, so the public link is https://cloud.domain.com/s/randompath.
  2. Visiting that link shows the upload interface, and the contents of the folder are not listed.
  3. A file is uploaded to the drop. The normal share view still shows nothing.
  4. The researcher then requests the same share token through the gallery app instead: https://cloud.domain.com/apps/gallery/s/randompath.
  5. The gallery renders every media file in the folder that it can display. In this case the drop was used for pictures, so all uploaded images were shown and could be downloaded, even though the share had "hide download" enabled.

The researcher notes that Nextcloud 17 was not covered by the security policy, but should be once released. It gives no fix details, no bounty amount and no further reproduction steps. The platform records the severity as medium with a CVSS score of 5.0.

Root cause

The report shows the gallery app serving the share's contents despite the upload-only restriction. The normal share view showed nothing, while the gallery route listed the folder contents. Files could also be downloaded even though the share had "hide download" enabled. The report does not describe the code path, The report does not describe the code path behind the behaviour.

Impact

Anyone who knows or obtains the share token can view and download every media file uploaded to the drop, defeating the purpose of an upload-only share. The researcher describes this as potentially critical in settings such as a hospital or the police, where a drop is used to collect sensitive material from third parties. The report does not demonstrate access to non-media files or to anything outside the shared folder.

How this kind of bug works

Many applications expose the same shared resource through more than one route: a canonical public link, a mobile or API endpoint, a preview or thumbnail service, a gallery or media viewer, and sometimes a WebDAV or sync interface. Each route is expected to load the share, check its permissions and then act. When a new route is added, or when an existing one is refactored, the permission check is easy to omit, because the developer focuses on rendering rather than authorisation.

Upload-only and "hide download" are restrictions layered on top of a share that still has a token and a folder behind it. The token is the only secret, so any route that accepts the token and skips the restriction turns a write-only drop into a read channel. The same pattern appears with password-protected shares, expiry dates and per-file download limits: the canonical link enforces them, secondary routes may not.

The defence is centralised authorisation: every route that resolves a share should go through one function that returns the effective permissions, and each handler should check the specific capability it needs (read, list, download) before returning data. Tests should cover each route against each share type.

How to test for it

  1. Create a share of the restrictive kind you want to test, such as upload-only, password-protected or download-hidden, and note the token.
  2. Confirm the canonical link enforces the restriction: no listing, no download, or a password prompt.
  3. Enumerate the other routes that accept the same token. Look for gallery, media, preview, thumbnail, API, mobile, WebDAV and legacy paths, and for parameters that select a view or file.
  4. Request each route with the token and compare the response with the canonical one. A positive result is content, a file listing or a download that the canonical route refuses.
  5. Try the same with a second account or a logged-out session, so that your own privileges cannot explain the result.

Common false positives: a cached response from before the restriction was applied, a route that returns metadata but no content, a preview that is generated only for files you are authorised to see, and differences caused by your session rather than the token. Clear caches and retest in a private window before reporting.

How it is fixed

Route every share-consuming handler through a single permission check, and make each handler assert the capability it needs before returning data. Apply the same check to listing, previews, thumbnails and downloads, and treat "hide download" as a separate flag that must be honoured wherever content is served. Add regression tests that exercise each route against upload-only, password-protected and download-hidden shares.

Hunting notes

This bug class hides where features multiply: media galleries, preview generators, document viewers, search, activity feeds, trash and version views, and API versions kept for older clients. Recon signals include a public share path plus a separate app path that also takes a share token, and any endpoint whose name suggests it renders or converts files. When you find one, show impact concretely: upload a distinctive file to a drop you control, retrieve it through the alternate route, and include the request and response that prove the restriction was bypassed. State clearly which restriction was defeated and what an unauthorised party could read.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

Nextcloud is a self-hosted service for storing and sharing files, a bit like running your own private Google Drive. One of its features is a file drop: a folder you share with a public link so that other people can upload files into it, without being able to see what is already inside. Think of a suggestion box: anyone can put a note in, nobody can read the notes already there.

They created a folder, set the share to upload-only, and checked that the normal public link behaved correctly. Then they tried a second way of reaching the same share, through the gallery app, and found that the upload-only restriction was ignored there.

Here is the sequence, step by step.

  1. The folder was shared as upload-only. The public link looks like this:
Text
https://cloud.domain.com/s/randompath

The part after /s/ is the share token: a long random string that acts as the key to the share. Anyone who has the link has the key, so the token is the only secret protecting the folder.

  1. Visiting that link shows the upload interface. The contents of the folder are not listed. This is the intended behaviour of a file drop, and it matters because it confirms the share itself was configured correctly.

  2. A file is uploaded to the drop. The normal share view still shows nothing, which is again correct.

  3. The researcher then requested the same share token through the gallery app instead:

Text
https://cloud.domain.com/apps/gallery/s/randompath

This is the same server, the same folder and the same token, but a different route. A route (or path) is the part of a URL that tells the server which feature should handle the request. /s/ is the ordinary public share page; /apps/gallery/ is the photo gallery feature. The gallery is the photo gallery feature, and it also accepts a share token.

  1. The gallery rendered every media file in the folder that it could display. In this case the drop was used for pictures, so all uploaded images were shown and could be downloaded, even though the share had "hide download" enabled. "Hide download" is an option that is supposed to stop visitors from saving the files.

The researcher notes that Nextcloud 17 was not covered by the security policy, but should be once released. It gives no fix details and no bounty amount. The platform records the severity as medium with a CVSS score of 5.0. CVSS is a standard scoring system for the seriousness of a security flaw; 5.0 sits in the middle of the scale.

Why it matters

Anyone who knows or obtains the share token can view and download every media file uploaded to the drop, which defeats the whole purpose of an upload-only share. The researcher describes this as potentially critical in settings such as a hospital or the police, where a drop is used to collect sensitive material from third parties. The report does not demonstrate access to non-media files or to anything outside the shared folder.

In general, how this kind of bug works

Many applications expose the same shared resource through more than one route: a canonical public link, a mobile or API endpoint, a preview or thumbnail service, a gallery or media viewer, and sometimes a WebDAV or sync interface. WebDAV is a protocol that lets programs mount and sync files over the web. Each route is expected to load the share, check its permissions and then act. When a new route is added, or an existing one is refactored, the permission check is easy to omit, because the developer focuses on rendering rather than authorisation, which is the act of deciding whether a given visitor is allowed to do a given thing.

Upload-only and "hide download" are restrictions layered on top of a share that still has a token and a folder behind it. The token is the only secret, so any route that accepts the token and skips the restriction turns a write-only drop into a read channel. The same pattern appears with password-protected shares, expiry dates and per-file download limits: the canonical link enforces them, secondary routes may not.

The defence is centralised authorisation: every route that resolves a share should go through one function that returns the effective permissions, and each handler should check the specific capability it needs (read, list, download) before returning data. Tests should cover each route against each share type.

In general, how to test for it

  1. Create a share of the restrictive kind you want to test, such as upload-only, password-protected or download-hidden, and note the token.
  2. Confirm the canonical link enforces the restriction: no listing, no download, or a password prompt.
  3. Enumerate the other routes that accept the same token. Look for gallery, media, preview, thumbnail, API, mobile, WebDAV and legacy paths, and for parameters that select a view or file.
  4. Request each route with the token and compare the response with the canonical one. A positive result is content, a file listing or a download that the canonical route refuses.
  5. Try the same with a second account or a logged-out session, so that your own privileges cannot explain the result.

Common false positives: a cached response from before the restriction was applied, a route that returns metadata but no content, a preview that is generated only for files you are authorised to see, and differences caused by your session rather than the token. Clear caches and retest in a private window before reporting.

In general, how it is fixed

Route every share-consuming handler through a single permission check, and make each handler assert the capability it needs before returning data. Apply the same check to listing, previews, thumbnails and downloads, and treat "hide download" as a separate flag that must be honoured wherever content is served. Add regression tests that exercise each route against upload-only, password-protected and download-hidden shares.

In general, where to look

This bug class hides where features multiply: media galleries, preview generators, document viewers, search, activity feeds, trash and version views, and API versions kept for older clients. Recon signals include a public share path plus a separate app path that also takes a share token, and any endpoint whose name suggests it renders or converts files. When you find one, show impact concretely: upload a distinctive file to a drop you control, retrieve it through the alternate route, and include the request and response that prove the restriction was bypassed. State clearly which restriction was defeated and what an unauthorised party could read.

Glossary

  • Nextcloud: self-hosted software for storing and sharing files.
  • File drop: a shared folder that lets visitors upload files without seeing what is already inside.
  • Share token: the random string in a share link that acts as its key.
  • Route (path): the part of a URL that tells the server which feature should handle the request.
  • Gallery app: the Nextcloud feature that displays pictures in a grid.
  • Hide download: a share option meant to stop visitors from saving files.
  • CVSS: a standard scoring system for the seriousness of a security flaw.
  • Authorisation: deciding whether a visitor is allowed to perform a given action.
  • WebDAV: a protocol that lets programs mount and sync files over the web.
  • Endpoint: a specific address on a server that accepts requests.
  • Metadata: information about a file, such as its name or size, rather than its content.
  • False positive: a finding that looks like a flaw but is not one.
  • Regression test: an automated test that checks a fixed bug stays fixed.

More by nursoda

View all

1 more disclosed report, 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.