Page MenuHomePhabricator

Special:GlobalUserRights reveals existence of globally suppressed users (CVE-2021-36127)
Closed, ResolvedPublicSecurity

Description

Globally suppressed users should be treated like they don't exist, but Special:GlobalUserRights reveals the existence of them. See related T276306: CVE-2021-30156: Special:Contributions toolbar reveals existence of hidden users and T270453: CVE-2021-30153: ApiVisualEditor leaks info about hidden users.

Steps to reproduce
  1. Globally suppress an account, e.g. Some Account.
  2. Goto Special:GlobalUserRights/Some Account, where Some Account is that globally suppressed account.
Expected result

nonexisting.png (308×751 px, 11 KB)

Actual result

suppressed.png (421×733 px, 17 KB)

(screenshots were taken on beta cluster)

Event Timeline

This patch should do the job:


(untested, as I do not have a local CentralAuth setup)

@Zabe this patch works for globally suppressed users, but there are some users who have both gu_status and lists as attributes, in the database still have the same error message. Not sure if the patch should cover those users as well. Another patch can be submitted if that's the case. More context for hidden lists -> https://phabricator.wikimedia.org/T192957

@Zabe this patch works for globally suppressed users, but there are some users who have both gu_status and lists as attributes, in the database still have the same error message. Not sure if the patch should cover those users as well. Another patch can be submitted if that's the case. More context for hidden lists -> https://phabricator.wikimedia.org/T192957

Users with $mHidden set to 'lists' will be hidden on Special:CentralAuth and Special:GlobalUsers. Therefore I assume that they should also be hidden on Special:GlobalUserRights. So let me create a second patchset, which includes users with $mHidden set to 'lists'. On the other hand, I have to say that I don't know what you mean by gu_status.


patchset 2

sbassett subscribed.

+1 to the patch above. We can try to get this updated patch out sometime this week during a train-friendly/backport window-friendly time.

The patch was applied with .9 and .11 (https://sal.toolforge.org/log/VEzWOnoB1jz_IcWuA5fo), but this patch doesn't handle the user id scenario. This is mentioned in T260863 which was merged into this ticket.

This is mentioned in T260863 which was merged into this ticket.

Yeah, I can't see that one.


patchset 3

This now includes a fix for the user id scenario described in T260863. Sorry for me don't adding that in the previous one.


patchset 3

+1 to PS3. I feel like the logic could be condensed a bit more to be a bit more DRY, but this is fine for a security patch.

This now includes a fix for the user id scenario described in T260863. Sorry for me don't adding that in the previous one.

No problem, there are plenty of somewhat dated and forgotten bugs in Phab that deal with similar issues :) Given how long T260863 was open, I think it can likely wait for deployment for next Monday's (2021-06-28) security window, unless anyone has more immediate concerns about it.

I'm getting this on testwiki

[13f616c5-872f-4580-9947-57a0d6bfe4fc] /wiki/Special:GlobalUserRights?user=%2363654358 Error: Call to private CentralAuthGroupMembershipProxy::__construct() from context 'SpecialGlobalGroupMembership'

Backtrace:

from /srv/mediawiki/php-1.37.0-wmf.12/extensions/CentralAuth/includes/specials/SpecialGlobalGroupMembership.php(101)
#0 /srv/mediawiki/php-1.37.0-wmf.12/includes/specials/SpecialUserrights.php(141): SpecialGlobalGroupMembership->fetchUser(string, boolean)
#1 /srv/mediawiki/php-1.37.0-wmf.12/includes/specialpage/SpecialPage.php(646): UserrightsPage->execute(NULL)
#2 /srv/mediawiki/php-1.37.0-wmf.12/includes/specialpage/SpecialPageFactory.php(1362): SpecialPage->run(NULL)
#3 /srv/mediawiki/php-1.37.0-wmf.12/includes/MediaWiki.php(314): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#4 /srv/mediawiki/php-1.37.0-wmf.12/includes/MediaWiki.php(917): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.37.0-wmf.12/includes/MediaWiki.php(551): MediaWiki->main()
#6 /srv/mediawiki/php-1.37.0-wmf.12/index.php(53): MediaWiki->run()
#7 /srv/mediawiki/php-1.37.0-wmf.12/index.php(46): wfIndexMain()
#8 /srv/mediawiki/w/index.php(3): require(string)
#9 {main}

@Zabe - yep, fixing with reverts right now.


sorry, fixed the issue, if you haven't done that by your own already.


sorry, fixed the issue, if you haven't done that by your own already.

Ok, thanks. We'll pull to an mwdebug to test first this time.

Ok, the buggy PS3 patch made it to wmf.11 and wmf.12 for a bit, but was reverted (1, 2). The new PS4 patch that fixed the bug was tested on mwdebug1002 and looked fine and was deployed to wmf.11 and wmf.12 (1, 2). We tested the enwiki link from T260863 and there were no errors, and nothing in logstash either. So I think we're good for now.

sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".Jul 1 2021, 10:43 PM
sbassett changed the edit policy from "Custom Policy" to "All Users".

Change 702771 had a related patch set uploaded (by SBassett; author: Zabe):

[mediawiki/extensions/CentralAuth@master] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702722 had a related patch set uploaded (by SBassett; author: Zabe):

[mediawiki/extensions/CentralAuth@REL1_36] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702723 had a related patch set uploaded (by SBassett; author: Zabe):

[mediawiki/extensions/CentralAuth@REL1_35] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702724 had a related patch set uploaded (by SBassett; author: Zabe):

[mediawiki/extensions/CentralAuth@REL1_31] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702771 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702724 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@REL1_31] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702723 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@REL1_35] SECURITY: Act like users don't exist if hidden from viewer

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

Change 702722 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@REL1_36] SECURITY: Act like users don't exist if hidden from viewer

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

sbassett renamed this task from Special:GlobalUserRights reveals existence of globally suppressed users to Special:GlobalUserRights reveals existence of globally suppressed users (CVE-2021-36127).Jul 2 2021, 8:04 PM
sbassett moved this task from Watching to Our Part Is Done on the Security-Team board.