Last modified: 2014-02-12 23:32:45 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 T47355, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45355 - Read of arbitrary files through mwdoc-filter.php
Read of arbitrary files through mwdoc-filter.php
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.20.x
All All
: Unprioritized normal (vote)
: 1.20.x release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-25 15:10 UTC by Platonides
Modified: 2014-02-12 23:32 UTC (History)
8 users (show)

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


Attachments

Description Platonides 2013-02-25 15:10:46 UTC
The file maintenance/mwdoc-filter.php can be abused under certain server configurations to read the contents of arbitrary files.

In case you
 - you have deleted the maintenance folder or
 - you have that folder denied in the server configuration or
 - the server is processing .htaccess overrides or
 - you are using PHP 5.4.0 (or later) or 
 - you have register_globals disabled
it is believed that you are not vulnerable.


Explaining the conditions above:
- MediaWiki bundles maintenance/.htaccess with 'Deny from all'

- register_globals was removed in PHP 5.4.0

 -If register_globals is disabled, register_argc_argv doesn't seem to make a difference.

- If register_argc_argv is enabled, it overwrites the $argv from register globals to a single argument, so there's no $argv[1] to open... unless you use a + (no %20), so there are really two ways to exploit this, depending on register_argc_argv

Verified with PHP 5.3.2

An insecure wrapper as mentioned in http://www.php.net/archive/2012.php#id2012-05-06-1 doesn't seem to allow splitting $argv into several items.

mwdoc-filter.php is intended for usage by doxygen through the cli sapi, was added in ab59fadb https://gerrit.wikimedia.org/r/17192 and is present in 1.20 and master (git branch -a --contains ab59fadb)
Comment 1 Platonides 2013-02-25 15:19:50 UTC
Patchset for master on https://gerrit.wikimedia.org/r/50750
Backport for 1.20 on https://gerrit.wikimedia.org/r/50751
Comment 2 Chris Steipp 2013-02-25 17:27:33 UTC
Thanks for the report and patch Platonides! This is confirmed. I think the likelihood that a configuration would be vulnerable is low, but the impact is high. We'll get this released as soon as possible.

In the future, please do post patches to the bug instead of gerrit, so we can coordinate the release, if possible.
Comment 3 Chris Steipp 2013-03-04 19:15:00 UTC
Released as part of 1.20.3
Comment 4 Chris Steipp 2013-03-05 17:41:51 UTC
RedHat has assigned CVE-2013-1818 for this issue.

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


Navigation
Links