We don't rate limit uploading files. We should.
patch:
- 1.25 - same as master ( )
- 1.24 - same as master ( )
- 1.23 -
affected versions:
type: dos
CVE: CVE-2015-8003
csteipp | |
Mar 7 2015, 1:06 AM |
F2724581: T91850c-REL1_23.patch | |
Oct 15 2015, 8:24 PM |
F2724543: T91850c-REL1_23.patch | |
Oct 15 2015, 7:53 PM |
F361708: T91850c.patch | |
Aug 4 2015, 1:27 AM |
F191194: T91850b.patch | |
Jul 10 2015, 11:05 PM |
F188249: T91850-exploit.php | |
Jul 2 2015, 4:27 PM |
F188047: T91850.patch | |
Jul 1 2015, 6:00 PM |
We don't rate limit uploading files. We should.
patch:
affected versions:
type: dos
CVE: CVE-2015-8003
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/core | REL1_26 | +30 -0 | SECURITY: Throttle uploads | |
mediawiki/core | master | +30 -0 | SECURITY: Throttle uploads | |
mediawiki/core | REL1_24 | +30 -0 | SECURITY: Throttle uploads | |
mediawiki/core | REL1_23 | +30 -0 | SECURITY: Throttle uploads | |
mediawiki/core | REL1_25 | +30 -0 | SECURITY: Throttle uploads |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T108064 MediaWiki Security release 1.25.3 | |||
Resolved | csteipp | T91850 No rate limits on uploading files | |||
Resolved | Anomie | T91205 ApiUpload needs sanity check on chunk size |
Ran into my first stab at this while working on something else, so figured I should just finish it.
I don't like checking all the entrypoints, but that's where we do the rights and block checks, so seemed like a logical place. Not sure if there are other ways to upload files? Maybe extensions?
@csteipp, I observed that the upload was appropriately throttled, from both the API and the web form. However, I also noticed that simply viewing the web form is also throttled. If I navigate to http://localhost:8080/wiki/Special:Upload, then hit refresh without selecting a file or submitting the form, I receive the action-throttled message in the browser.
In the API bit, a chunked upload would be applying the throttle to each chunk of the file.
It also throttles the polling for status if the client is waiting for an async upload or an upload-from-url. Even if the former is intended, this probably isn't.
Moved the throttling later in both the special page and api, so chunks and warnings are correctly handled. This allows a user to upload to the stash unthrottled. Otherwise in UploadWizard, the upload to the stash was one count against the throttle, then finalizing the upload was a second. I'm not sure if that's the right behavior or not. As a side effect, you can add more files to the initial step of UploadWizard than the throttle allows, and UploadWizard just fails to move the file from the stash. Except for missing an api-error-ratelimited message, the failure is fairly graceful.
@MarkTraceur, is there someone on the multimedia team who can comment on this?
My two cents: This sounds fine, James_F might want to comment, but UploadWizard already throttles to 3 uploads to stash or 3 stash upload finalizations at once (per window, I guess), so this doesn't look like a huge issue from that end.
When uploading at http://localhost:8080/wiki/Special:Upload, I now get throttled message after the final form submission, after the file has been uploaded and compared to existing files, and I've entered a description. This might be frustrating for users. Other than this, the patch looks good.
Made Special:Upload use a RecoverableUploadError instead of throwing an exception. So error message is a little nicer.
Change 246879 had a related patch set uploaded (by Chad):
Add throttle check in ApiUpload and SpecialUpload.
This was assigned CVE-2015-8003, with the caveat:
Use CVE-2015-8003. An important note here is that the MITRE CVE team
accepted this CVE request only because it came from the organization
that wrote the code. In the general case, adding completely new
functionality such as an upload rate limit is a security enhancement
and not eligible for a CVE ID.
Since MediaWiki generally considers uploads as an edit, and edits are throttled, I think the CVE here was appropriate.