I blocked a misbehaving bot on-wiki and it was still able to send purges via the API until its IP range was blocked through varnish. I expect that an account that is sitewide blocked is unable to issue purges via the API or index.php.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Reedy | T279725 Release MediaWiki 1.31.15/1.35.3/1.36.1 | |||
Resolved | Reedy | T279726 Tracking bug for MediaWiki 1.31.15/1.35.3/1.36.1 | |||
Resolved | Security | Reedy | T280226 CVE-2021-35197: Blocked users should not be able to issue purges (action=purge) |
Event Timeline
Fix to PurgeAction is very trivial... Just remove the requiresUnblock override.
Api is similarly easy, just re-use the code from ApiTag
// Fail early if the user is sitewide blocked. $block = $user->getBlock(); if ( $block && $block->isSitewide() ) { $this->dieBlocked( $block ); }
Patch incoming.
Plan is to get this out this week (well, tomorrow). So this patch will apply fine to 1.35 and 1.36 straight off.
For 1.31, the isSitewide wasn't added till 1.33... The change to PurgeAction is fine and can be applied as is.
Anyone got any preferred solution to this?
We could just use any block... Which seems probably the simplest way forward, as 1.31 has no concept of these other "types" of blocks, and is due to become EOL this month... But is being extended for one more quarter to meet our LTS overlap requirements.
// Fail early if the user is blocked. $block = $user->getBlock(); if ( $block ) { $this->dieBlocked( $block ); }
Change 701143 had a related patch set uploaded (by Reedy; author: Reedy):
[mediawiki/core@REL1_31] SECURITY: Prevent blocked users from purging pages
Change 701146 had a related patch set uploaded (by Reedy; author: Reedy):
[mediawiki/core@REL1_35] SECURITY: Prevent blocked users from purging pages
Change 701150 had a related patch set uploaded (by Reedy; author: Reedy):
[mediawiki/core@REL1_36] SECURITY: Prevent blocked users from purging pages
Change 701153 had a related patch set uploaded (by Reedy; author: Reedy):
[mediawiki/core@master] SECURITY: Prevent blocked users from purging pages
Change 701143 merged by jenkins-bot:
[mediawiki/core@REL1_31] SECURITY: Prevent blocked users from purging pages
Change 701146 merged by jenkins-bot:
[mediawiki/core@REL1_35] SECURITY: Prevent blocked users from purging pages
Change 701150 merged by jenkins-bot:
[mediawiki/core@REL1_36] SECURITY: Prevent blocked users from purging pages
Change 701153 merged by jenkins-bot:
[mediawiki/core@master] SECURITY: Prevent blocked users from purging pages