Skip to content
Access control Disclosed report Beginner CVE-2016-9462

Read-only share recipient can restore old versions of file

The restore capability in Nextcloud did not check whether a user had only read-only access to a share. A user with read-only access could restore old versions of a file.

bugdiscloseguys Follow

Originally disclosed on HackerOne

Bounty$300incl. $50 bonus View original
  • Triaged in 1 hour
  • Fixed in 15 days
  • Paid in 2 hours
  • Disclosed after 29 days

Summary by the program

The restore capability of Nextcloud was not verifying whether an user has only read-only access to a share. Thus an user with read-only access was able to restore old versions.

A detailed advisory can be found at https://nextcloud.com/security/advisory/?id=nc-sa-2016-005.


Thanks a lot, @bugdiscloseguy for pointing out this vulnerability!

On request of the reporter this report has been only disclosed limitedly.

The original report as published on HackerOne, by bugdiscloseguys. 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 Nextcloud's file versioning feature, specifically the restore capability. The report is short and consists mainly of the program's own summary, so the technical detail available is limited.

The program summary states that the restore capability did not verify whether a user had only read-only access to a share. As a result, a user holding read-only access to a share was able to restore old versions of files.

The researcher credited in the report is bugdiscloseguy, who pointed out the vulnerability. The report does not describe the individual steps taken to reproduce it, and no requests, payloads or commands appear in the text. A detailed advisory is referenced at the following address:

Text
https://nextcloud.com/security/advisory/?id=nc-sa-2016-005

The weakness is classified as improper authentication, generic. No severity rating or CVSS score is given. The report notes that, at the reporter's request, it was disclosed only in a limited way.

Root cause

The report states that the restore capability did not verify whether a user had only read-only access to a share. The share permission model distinguishes between read-only access and write access, The restore operation did not verify whether the user had only read-only access to the share.. Restoring a version is a write operation against the file, so it should have required the same permission as any other modification.

Impact

A user with read-only access to a share could restore old versions of files. In practice this means a recipient who was only meant to view content could change what the current content is, by rolling a file back to an earlier state. The report does not describe any further consequences, such as data loss, overwriting of newer work, or whether the restored version was visible to the share owner. The impact should be read as bounded by what the summary states: a read-only recipient gains the ability to perform a write-like action on versioned files.

How this kind of bug works

Versioning systems keep historical copies of files and expose operations to list, download and restore them. These operations are often implemented as separate endpoints from the normal file upload and edit paths, and they are frequently added after the core permission model is in place. The permission check on the main file endpoint may be thorough while the versioning endpoint reuses only part of that logic, for example checking that the user can see the file but not that the user may modify it.

The bug class is a missing or incomplete authorisation check on a secondary feature that mutates state. It happens because permissions are enforced per endpoint rather than centrally, and because read-only shares are treated as a property of the share rather than re-evaluated for every operation. Defences are straightforward in principle: every state-changing operation must resolve the effective permission of the acting user on the underlying object, and restore must be treated as a write. Centralising permission checks, or deriving them from a single capability model, prevents the drift that produces these gaps.

How to test for it

A general method for this class:

  1. Identify features that mutate or expose historical state: version history, trash, restore, revert, undelete, comments, tags, sharing metadata.
  2. Set up two accounts and share a file or folder from one to the other with the most restrictive permission available, typically read-only or view-only.
  3. As the restricted recipient, exercise every operation the interface offers on the shared object, and also try the underlying endpoints directly, since the UI may hide buttons that the API still honours.
  4. For versioning specifically, create several versions as the owner, then attempt a restore as the recipient. A positive result is a successful state change: the file's current content becomes the older version, confirmed by fetching the file afterwards as the owner.
  5. Repeat with other permission combinations, such as share without re-share, or share with edit but without delete, to find checks that are missing rather than merely misconfigured.

Common false positives: the operation may appear to succeed in the UI while the server rejects it, so always confirm the resulting state from a second account. Cached responses can make a rejected restore look applied. A restore that only affects the recipient's local view, without changing the stored file, is not the bug. Also check whether the share was actually created with the permission you believe; some clients silently grant broader rights.

How it is fixed

A fix would be to enforce the share's permission level on the restore operation, requiring write or edit permission before a version can be made current. More robustly, the versioning code should call the same authorisation routine as ordinary file modification, so that any future permission changes apply automatically. Tests should cover restore, delete and other version operations against read-only shares. The report itself does not describe the fix; the referenced advisory would contain it.

Hunting notes

This class tends to hide in features bolted onto a mature permission model: versioning, trash and restore, activity feeds, previews, and bulk operations. Recon signals include APIs whose paths differ from the main object path, such as separate version or history routes, and interfaces that render action buttons conditionally, which suggests the server may not enforce the same condition. Documentation that lists permissions per share type is useful for spotting operations that are not mentioned.

To make a report accepted, demonstrate the state change end to end with two accounts, show the permission level of the share explicitly, and show the before and after state of the file from the owner's side. Keep the reproduction minimal and state clearly which check is missing. Where a program asks for limited disclosure, respect it and keep sensitive detail out of the public report.

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. 7 min read.

What happened, in plain words

Nextcloud is a piece of software for storing and sharing files, a bit like a private version of Google Drive that you or a company can run on your own server. One of its features is versioning: every time a file is saved, the software keeps the older copies, so you can go back to an earlier draft if something goes wrong. The act of bringing an old copy back is called restoring a version.

Sharing in Nextcloud comes with permissions, which are rules about what the person you share with is allowed to do. The most restrictive common setting is read-only: the recipient can open and download the file but should not be able to change it in any way.

The report is about a gap between those two ideas. According to the program's summary, the restore capability did not check whether the user had only read-only access to a share. So a person who was only supposed to look at a file could restore an old version of it. Restoring a version changes what the current file contains, which is a form of editing. A read-only recipient should never have been able to do that.

The researcher credited is bugdiscloseguy, who pointed out the vulnerability. The report does not describe the individual steps taken to reproduce it, and no requests, payloads or commands appear in the text. A detailed advisory is referenced at the following address:

Text
https://nextcloud.com/security/advisory/?id=nc-sa-2016-005

The weakness is classified as improper authentication, generic. No severity rating or CVSS score is given. The report notes that, at the reporter's request, it was disclosed only in a limited way.

Root cause

The report states that the restore capability did not verify whether a user had only read-only access to a share. It helps to separate two words that sound alike. Authentication is proving who you are, like showing a passport at a border. Authorisation is deciding what you are allowed to do once you are known, like the passport not granting you the right to enter every room in the building. Here the user's identity was known; what was missing was a check of that user's rights over the share.

The share permission model distinguishes between read-only access and write access, The restore operation did not verify whether the user had only read-only access to the share.. Restoring a version is a write operation against the file, so it should have required the same permission as any other modification.

Impact

A user with read-only access to a share could restore old versions of files. In practice this means a recipient who was only meant to view content could change what the current content is, by rolling a file back to an earlier state. The report does not describe any further consequences, such as data loss, overwriting of newer work, or whether the restored version was visible to the share owner. The impact should be read as bounded by what the summary states: a read-only recipient gains the ability to perform a write-like action on versioned files.

How this kind of bug works

In general, versioning systems keep historical copies of files and expose operations to list, download and restore them. These operations are often implemented as separate endpoints from the normal file upload and edit paths, and they are frequently added after the core permission model is in place. An endpoint is simply a specific address on the server that the browser or app talks to, for example one address for uploading a file and a different one for listing its old versions.

The permission check on the main file endpoint may be thorough while the versioning endpoint reuses only part of that logic, for example checking that the user can see the file but not that the user may modify it. A useful everyday comparison is a hotel: the front desk carefully checks who gets a room key, but a side door added later is left unlocked because nobody thought to connect it to the same lock system.

The bug class is a missing or incomplete authorisation check on a secondary feature that mutates state. It happens because permissions are enforced per endpoint rather than centrally, and because read-only shares are treated as a property of the share rather than re-evaluated for every operation. Defences are straightforward in principle: every state-changing operation must resolve the effective permission of the acting user on the underlying object, and restore must be treated as a write. Centralising permission checks, or deriving them from a single capability model, prevents the drift that produces these gaps.

How to test for it

In general, a method for this class looks like this:

  1. Identify features that mutate or expose historical state: version history, trash, restore, revert, undelete, comments, tags, sharing metadata.
  2. Set up two accounts and share a file or folder from one to the other with the most restrictive permission available, typically read-only or view-only.
  3. As the restricted recipient, exercise every operation the interface offers on the shared object, and also try the underlying endpoints directly, since the UI may hide buttons that the API still honours. The API is the set of addresses and rules the software uses behind the scenes; the buttons on screen are only a friendly layer over it.
  4. For versioning specifically, create several versions as the owner, then attempt a restore as the recipient. A positive result is a successful state change: the file's current content becomes the older version, confirmed by fetching the file afterwards as the owner.
  5. Repeat with other permission combinations, such as share without re-share, or share with edit but without delete, to find checks that are missing rather than merely misconfigured.

Common false positives: the operation may appear to succeed in the UI while the server rejects it, so always confirm the resulting state from a second account. Cached responses can make a rejected restore look applied. A restore that only affects the recipient's local view, without changing the stored file, is not the bug. Also check whether the share was actually created with the permission you believe; some clients silently grant broader rights.

How it is fixed

In general, a fix would be to enforce the share's permission level on the restore operation, requiring write or edit permission before a version can be made current. More robustly, the versioning code should call the same authorisation routine as ordinary file modification, so that any future permission changes apply automatically. Tests should cover restore, delete and other version operations against read-only shares. The report itself does not describe the fix; the referenced advisory would contain it.

Hunting notes

In general, this class tends to hide in features bolted onto a mature permission model: versioning, trash and restore, activity feeds, previews, and bulk operations. Recon signals include APIs whose paths differ from the main object path, such as separate version or history routes, and interfaces that render action buttons conditionally, which suggests the server may not enforce the same condition. Documentation that lists permissions per share type is useful for spotting operations that are not mentioned.

To make a report accepted, demonstrate the state change end to end with two accounts, show the permission level of the share explicitly, and show the before and after state of the file from the owner's side. Keep the reproduction minimal and state clearly which check is missing. Where a program asks for limited disclosure, respect it and keep sensitive detail out of the public report.

Glossary

  • Nextcloud: file storage and sharing software that can be run on your own server.
  • Versioning: keeping older copies of a file so you can return to them later.
  • Restore: making an older version of a file the current one again.
  • Share: giving another user access to a file or folder you own.
  • Permission: a rule about what a user is allowed to do with a shared item, such as view or edit.
  • Read-only: a permission that allows viewing and downloading but not changing.
  • Write access: a permission that allows changing the content of a file.
  • Authentication: proving who you are.
  • Authorisation: deciding what a known user is allowed to do.
  • Endpoint: a specific address on a server that a browser or app sends requests to.
  • API: the set of addresses and rules software uses to talk to a server behind the scenes.
  • State change: any action that alters stored data, such as editing or restoring a file.
  • Mutate: to change data.
  • False positive: a result that looks like a bug but is not one.
  • Cache: a stored copy of earlier data that can make an old result appear current.
  • Bounty: a payment some companies give for responsibly reported security problems.
  • CVSS: a standard scoring system for the severity of a security flaw.
  • Advisory: a public notice describing a security flaw and its fix.
  • Disclosure: making the details of a security report public.

More by bugdiscloseguys

View all

12 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.