Page MenuHomePhabricator

Soft GlobalBlocks against an IP address should block temporary accounts using that IP address
Closed, ResolvedPublic

Description

Background

A soft block against an IP address blocks users from the IP who are not logged in, but does not block users from that IP who are logged in.

Following T343714, soft blocks do block temporary users.

Global blocks are blocks that block an IP address from every wiki. These can also be soft blocks.

Global soft blocks should block temporary users, similarly to local (single-wiki) soft blocks.

Testing steps

  • Set the following config in LocalSettings.php:
$wgGroupPermissions['sysop']['globalblock'] = true;
$wgAutoCreateTempUser['enabled'] = true;
  • Log out, and edit a page. This will create a temporary user.
  • In a private tab (i.e. preserving your temporary user's session), log in as an admin/sysop
    • Go to Special:GlobalBlock
    • Block your local IP address, checking "Globally block anonymous users only", e.g.:

image.png (636ร—1 px, 78 KB)

    • Log out
  • As the temporary user, attempt to edit a page again

Before this task: The temporary user is allowed to edit (because the IP block does not apply)
After this task: The temporary user is not allowed to edit, and sees a notice about the global block, e.g.:

image.png (380ร—1 px, 81 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptAug 25 2023, 11:03 AM

Change 952355 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/GlobalBlocking@master] Ensure that soft global blocks block temporary users

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

Change 952355 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Ensure that soft global blocks block temporary users

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

@Tchanders I find an anonymous global block does not apply to temporary users if the IP is in their XFF headers.

Change 955330 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/GlobalBlocking@master] Ensure that soft blocks against XFF IPs block temporary users

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

Change 955330 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Ensure that soft blocks against XFF IPs block temporary users

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

Thanks @dom_walden - should be fixed by the latest patch.

Thanks. Global blocks now apply to XFF headers. Will move to done.