Page MenuHomePhabricator

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

Description

From the parent task:

  • If the "Apply block to logged-in users from this IP address" is unchecked, should it block temporary account users?

Yes. Temporary accounts should not be treated the same as “logged-in users”.

Note that GlobalBlocking recognizes "anon only" blocks too.

Event Timeline

Terminology for whether an IP block blocks logged-in users:

  • ipblocks.ipb_anon_only - database field
  • AbstractBlock::isHardblock returns true if the block should apply to logged-in users
  • anonOnly - option passed into the AbstractBlock constructor
  • isHardBlock - option passed to the BlockUser constructor
  • wpHardBlock - parameter passed to Special:Block
  • ipb-hardblock - message key for Special:Block field
  • anononly - parameter passed to ApiBlock
  • anononly - result returned from ApiQueryBlocks
  • blockanononly - result returned via ApiBlockInfoTrait
  • block-log-flags-anononly - message key for block log
  • disable-hardblock - option passed to blockUsers maintenance script
  • anononlyblock - message key for Special:BlockList

"Hardblock" (and "softblock") aren't problematic, but the use of "anononly" (and similar terms) presents a bit of a terminology problem. We're trying to avoid calling temporary users "anon", in line with T337103: Decide a standard approach for classifying temporary, IP and registered users, but we do want temporary users to be blocked by so-called "anon-only" blocks.

We should update documentation in all the places listed above, and explicitly mention the fact that the term is misleading and only kept for backwards compatibility, wherever "anon" is used.

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

[mediawiki/core@master] Ensure that soft blocks block temporary users

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

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

[mediawiki/core@master] Ensure soft blocks against IP in XFF block temporary users

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

@Tchanders Should this apply also to XFF blocks?

Yes - I started out doing this as part of T343704, then changed my mind and forgot to add it in here. Done in the new patch. Thanks for catching this!

Change 948537 abandoned by Tchanders:

[mediawiki/core@master] Ensure soft blocks against IP in XFF block temporary users

Reason:

Squashed into I5a2928eb3370bd47544b164b08014ef62297ce36

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

Change 946980 merged by jenkins-bot:

[mediawiki/core@master] Ensure that soft blocks block temporary users

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

Anonymous (IP) and temporary users are blocked in the same way.

I tested database blocks, global blocks, $wgSoftBlockRanges, $wgProxyList and $wgDnsBlacklistUrls. I also tested blocking XFF.

The only exception is for anonymous global blocks, which don't apply to temporary users (which we will fix in a separate task.)

The only difference I saw was T344703.

Test environment: local docker MediaWiki 1.41.0-alpha (bd31b57) 01:46, 22 August 2023.

The only exception is for anonymous global blocks, which don't apply to temporary users (which we will fix in a separate task.)

Filed as T344988