Last modified: 2013-08-28 18:42:39 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 T55423, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53423 - OAuth allows to view accepted consumers of other users
OAuth allows to view accepted consumers of other users
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
OAuth (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Aaron Schulz
https://www.mediawiki.org/wiki/Specia...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-27 20:44 UTC by Mormegil
Modified: 2013-08-28 18:42 UTC (History)
3 users (show)

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


Attachments

Description Mormegil 2013-08-27 20:44:05 UTC
[[Special:MWOAuthManageMyGrants]] does not check whether the ID passed as an URL argument belongs to the current user, and allows the user to view any existing accepted consumer settings (see e.g. the URL linked above). Fortunately, MWOAuthConsumerAcceptanceSubmitControl seems to check the current user correctly, so that attempts to modify the consumer should fail. So that while this is a security vulnerabilty, it is not a severe one.

I guess something like this could suffice?

--- a/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
+++ b/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
@@ -102,10 +102,14 @@ class SpecialMWOAuthManageMyGrants extends UnlistedSpecialPage {
 		$user = $this->getUser();
 		$lang = $this->getLanguage();
 		$db = MWOAuthUtils::getCentralDB( DB_SLAVE );
+		$centralUserId = MWOAuthUtils::getCentralIdFromLocalUser( $user );
+		if ( !$centralUserId ) { // sanity
+			throw new PermissionsError();
+		}
 
 		$cmra = MWOAuthDAOAccessControl::wrap(
 			MWOAuthConsumerAcceptance::newFromId( $db, $acceptanceId ), $this->getContext() );
-		if ( !$cmra ) {
+		if ( !$cmra || $cmra->get( 'userId' ) !== $centralUserId ) {
 			$this->getOutput()->addHtml( $this->msg( 'mwoauth-invalid-access-token' )->escaped() );
 			return;
 		}
Comment 1 Chris Steipp 2013-08-27 21:00:52 UTC
Yikes. Aaron, could you test the patch?
Comment 2 Gerrit Notification Bot 2013-08-27 21:29:24 UTC
Change 81400 had a related patch set uploaded by Aaron Schulz:
Do not show grant change form if the user cannot submit it.

https://gerrit.wikimedia.org/r/81400
Comment 3 Gerrit Notification Bot 2013-08-28 17:30:52 UTC
Change 81400 merged by CSteipp:
Do not show grant change form if the user cannot submit it.

https://gerrit.wikimedia.org/r/81400

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


Navigation
Links