Page MenuHomePhabricator

Remove separate checks for global blocks from PasswordReset
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

PasswordReset::isBlocked checks for global blocks separately, and decides the user is blocked if ::appliesToPasswordReset returns true.

::appliesToPasswordReset never returns true for a GlobalBlock, so a global block alone does not block password reset (see appliesToPasswordReset definitions and isCreateAccountBlocked usage).

Additionally, after T257701: Add global blocks into CompositeBlocks rather than treating them separately, global blocks would not need to be checked separately anyway.

Acceptance criteria
  • PasswordReset::isBlocked no longer checks separately for global blocks.
Notes

Related question: Local blocks made by the GlobalBlocking extension do block password reset, by blocking account creation (example). Should global blocks block password reset and account creation? If so, this can be filed in a follow-up task and worked on separately.

Event Timeline

Password reset is a (minor) abuse vector, and it can be triggered from any wiki so normal blocks can't really prevent it. I think global blocks should apply to it.

Password reset is a (minor) abuse vector, and it can be triggered from any wiki so normal blocks can't really prevent it. I think global blocks should apply to it.

Ok makes sense - I've filled T317636: Global blocks should apply to password reset for that.

Have also blocked this task on T257701: Add global blocks into CompositeBlocks rather than treating them separately to ensure global blocks are still checked by password reset, until global blocks are checked together with other blocks.

Tchanders set the point value for this task to 2.Oct 11 2022, 5:42 PM

Change 842828 had a related patch set uploaded (by AGueyte; author: AGueyte):

[mediawiki/core@master] Remove Global blocks check from PasswordReset::isBlocked

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

Testing notes:

This can be tested on Beta. (I tested locally.)

I tested this by visiting Special:PasswordReset from a globally blocked IP address, with no other block, including no local block. As expected, a block error is encountered. Doing the same from an IP address with no block, I see the form.

Note that this requires the latest version of the GlobalBlocking extension.

Change 842828 merged by jenkins-bot:

[mediawiki/core@master] Remove separate Global blocks check from PasswordReset::isBlocked

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

@Tchanders I tested Global block, Composite Block, Range IPs, XFF, Sitewide and Partial blocks which all came up with the same block error as seen in the screenshots below.

The only thing that I came up with was that same error of the uncheck in Single:Block from T317325
If that error is ok, can I move this task to Done?

Beta test for Global block, Composite Block, Range IPs, Sitewide and Partial blocks

T317334_GB_PasswordReset_Chrome.png (1×2 px, 186 KB)

Local test for XFF

T317334_GB_PasswordReset_Chrome2.png (1×2 px, 162 KB)

The only thing that I came up with was that same error of the uncheck in Single:Block from T317325
If that error is ok, can I move this task to Done?

Sounds good to me - see T317325#8396613.

@Tchanders Same non issue as T317325#8396613. I will move this to Done. Thanks!