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

End to end encryption folder locking is not properly protected

The end-to-end encryption lock endpoint did not check whether the caller had access to the file being locked, so any authenticated user could lock arbitrary file IDs. By looping requests, an attacker could lock many IDs and prevent other users from interacting with their encrypted folders.

rtod Follow

Originally disclosed on HackerOne

Bounty$250 Low View original
  • Triaged in 35 hours
  • Fixed in 41 hours
  • Paid in 41 hours
  • Disclosed after 33 days

I do not see the end_to_end_encryption app listed here. But since you advertise it big on your website and in communication. And the clients (that also support it are covered) I assume this is part of the program as well.

  1. userA has end to end encryption setup
  2. userB wants to annoy userA
  3. userB starts to send curl request like
Bash
curl -u user1:user -X POST https://SERVER/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/332 -X POST  -H 'OCS-APIREQUEST: true' -H 'user-agent: Mozilla/5.0 (Android) Nextcloud-android/3.13.1'

Here 332 is a fileid. But it can be any fileid.

  1. If userB just keeps looping they can just lock all fileids. Limiting any other user from interacting with their encrypted folders.

Impact

userB in this case can avoid userA from interacting with their encrypted data. Effectively locking them out of adding new data.

Now admitted they do not know which file id the encrypted folder of userA is. But a small script can lock a lot of ids very quickly. And the job to fix this only runs once an hour and clears max 25. So I'm relatively sure that userB has a big advantage here.

Recommendations:

  1. While locking there should also be checks (like with unlocking) if the user has access
  2. There should be throttling on those endpoints esp if users try to lock things they have no access to

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 lock endpoint lacked an ownership or access check, unlike the unlock endpoint, and had no rate limiting.

Impact

An attacker could lock many file IDs and stop another user from adding data to their encrypted folders; the reporter notes the cleanup job runs hourly and clears at most 25 locks, giving the attacker an advantage.

What the attacker needed

An authenticated account; end-to-end encryption in use by the victim

How it was found

  1. Set up end-to-end encryption as one user
  2. As a second user, send a lock request for an arbitrary file ID
  3. Repeat the request in a loop to lock many file IDs

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 lock is meant to stop two people changing the same file at once. Here the server accepted lock requests for files the sender did not own, so anyone with an account could put a lock on someone else's file. Because the cleanup job is slow, an attacker could keep many files locked and block the real owner.

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.