Bypassing quota limit
A user with a storage quota could upload files beyond that quota by sending a malformed value in the OC-Total-Length header or by adding an X-Expected-Entity-Length header. This allowed the user to exceed their allocated storage and bypass administrator restrictions.
- Triaged in 9 hours
- Fixed in 2 months
- Disclosed after 5 months
Hi an user can upload files despite having a limited quota by changing value of "OC-Total-Length" in header to "A" or adding "X-Expected-Entity-Length" in header with "A" value
in normal insuffisant storage we have:
PUT /remote.php/webdav/a.jpg HTTP/1.1 Content-Type: application/octet-stream OC-Async: 1 OC-Chunk-Size: 10000000 OC-Total-Length: 200
Response HTTP/1.1 507 Insufficient Storage
after changing OC-Total-Length: A , the file is created and the response is:
HTTP/1.1 201 Created
the user can largely exceed its quota and bypass admin restriction affected version: Latest stable version: 10.0.1
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 server does not properly validate the numeric value of the OC-Total-Length header (and accepts an alternative X-Expected-Entity-Length header), so a non-numeric value causes the quota check to be skipped or to fail open.
Impact
A user could largely exceed their storage quota and bypass administrator restrictions.
What the attacker needed
A user account with a storage quota
How it was found
- Send a PUT request to upload a file with a valid OC-Total-Length header that exceeds the quota, and observe a 507 Insufficient Storage response.
- Change the OC-Total-Length header value to a non-numeric string such as 'A' (or add an X-Expected-Entity-Length header with value 'A').
- Send the modified request and observe that the file is created with a 201 Created response, bypassing the quota.
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 storage quota is a limit on how much data a user is allowed to store. The server checks the size of an upload by reading a number from a request header, but if that number is not a valid number (like the letter 'A'), the check fails and the upload is allowed anyway. This means a user can keep uploading files and use far more space than they are supposed to.
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.