End-to-end encrypted file-drops can be made inaccessible
An attacker who can obtain the metadata file of an end-to-end encrypted file drop can modify the entry for another user's uploaded file and upload a new metadata file, causing that file to become undecodable. This breaks the availability of the encrypted file.
- Disclosed after 3 months
Summary by the program
Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-x7c7-v5r3-mg37
The report
Assume a filedrop that is send to 2 people, USER and ATTACKER
- user uploads their E2EE encrypted fileA into the filedrop
- All goes well
- Now ATTACKER comes along and wants mess up the upload from USER
- They obtain the metadatafile
- They modify the entry in the filedrop list that USER created
- They upload their new metadatafile
- Unlock it
- FileA is now not able to be decoded at all anymore.
Impact
The CIA model (Confidentiality, integrity and availability) is here very easy to break. An attacker can almost trivially in this case break the availability. Note that due to the nature of providing the metadatafile an attacker can trivially know if there are other filedrop files.
To solve
- Do not provide the metadata file to the user in file drop at all
- Only send back the new entry (which they can create without the metadatafile)
- Append the new entry in the backend code.
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 file drop provides the metadata file to users and accepts client-supplied metadata updates without server-side validation, allowing an attacker to alter another user's entry.
Impact
An attacker can trivially break the availability of another user's encrypted file, and can also learn whether other files exist in the file drop.
What the attacker needed
Access to a file drop shared with the attacker; ability to obtain the metadata file
The fix
The metadata file should not be provided to users in a file drop; instead, only the new entry should be returned and appended in the backend code.
How it was found
- A user uploads an end-to-end encrypted file into a file drop shared with two people.
- The attacker obtains the metadata file.
- The attacker modifies the entry in the file drop list that the user created.
- The attacker uploads the modified metadata file and unlocks it.
- The user's file can no longer be decoded.
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.
In an end-to-end encrypted file drop, the server stores encrypted files and a separate metadata file. If an attacker can get that metadata file, they can change the entry for someone else's file and upload their altered version. The original file then cannot be decoded.
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.