Last modified: 2009-10-28 03:39:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23320, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21320 - API: upload-by-url attempts remote fetch even when upload-by-url is disabled
API: upload-by-url attempts remote fetch even when upload-by-url is disabled
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-28 02:48 UTC by Gurch
Modified: 2009-10-28 03:39 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gurch 2009-10-28 02:48:32 UTC
On en.wikipedia, I made an API query with the following parameters:

action = upload
format = xml
filename = Test.jpg
token = [some token]
url = http://www.example.com/something.jpg

The upload failed with the following result:

<?xml version="1.0"?><api><error code="&amp;lt;Error sending request: #28 connect() timed out!&amp;gt;" info="fetchfileerror" /></api>

I repeated this with a local test wiki and got this:

<?xml version="1.0"?><api><error code="An HTTP error occured: HTTP/1.1 404 Not Found" info="fetchfileerror" /></api>

and with a packet sniffer I see that indeed a "GET /something.jpg" HTTP request was sent to www.example.com.

I then repeated this with url set to an image that actually exists, http://www.google.com/intl/en_ALL/images/logo.gif - now my test wiki gives

<?xml version="1.0"?><api><upload upload_session_key="260384685" /></api>

which I think (the documentation is pretty much non-existent) is supposed to mean the upload succeeded, but in fact no file was uploaded.

Problem: Both my local wiki and en.wikipedia have $wgAllowCopyUploads set to false, and in neither case did the account I attempted this from have the upload_by_url right. 

MediaWiki shouldn't be going anywhere near the remote server unless the user has permission to upload by URL -- otherwise anyone with normal upload access can spam API queries with 'url' set to some huge file, and make the server eat its own bandwidth.
Comment 1 Michael Dale 2009-10-28 03:39:09 UTC
added early check of permissions in r58242

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links