Uploading files to a folder where invited user don't have any EDIT privilege
The WebDAV COPY action did not properly check permissions, so an authenticated user with read-only access to a shared folder could place new files into it. Existing files could not be modified.
Originally disclosed on HackerOne
- Triaged in 17 hours
- Fixed in 16 days
- Paid in 20 hours
- Disclosed after 30 days
Summary by the program
The WebDAV endpoint was not properly checking the permission on a WebDAV "COPY" action. This allowed an authenticated attacker with access to a read-only share to put new files in there. It was not possible to modify existing files.
A detailed advisory can be found at https://nextcloud.com/security/advisory/?id=nc-sa-2016-004.
Thanks a lot, @detroitsmash for pointing out this vulnerability!
The report
Hi,
Any invited user to a shared folder with no edit privilege can create files in it through copy feature of Nextclod android app.
Steps to reproduce it
- Create any folder and invite a user in it without any edit privilege.
- Now login from invited user account through android app.
- Copy any file from your
nextcloudroot folder to shared folder. - Check nextcloud web app!! Copied file will show in shared folder
Thanks
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
Impact
An authenticated user with only read access could add new files to a shared folder, though they could not modify existing ones.
What the attacker needed
An account on the server; invitation to a read-only shared folder
How it was found
- Create a folder and invite a user with no edit privilege.
- Log in as the invited user through the Android app.
- Copy a file from the root folder into the shared folder.
- Check the web app and see the copied file in the shared folder.
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.
A shared folder can be set so that an invited person may only look at files, not change them. The server handles file operations through a protocol called WebDAV, and one of its actions, copying a file, skipped the check that should have stopped a read-only user from adding anything. As a result the invited user could drop new files into a folder they were only meant to read.
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.