Page MenuHomePhabricator

CU 2.0: InvestigateBlock does not normalise IP range when leaving notice
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If I use Special:InvestigateBlock to block 192.168.121.180/29 and use the Leave a notice on User/User Talk page functionality, the notice is posted on User/User_talk:192.168.121.180/29.

The normalised version of that IP range is 192.168.121.176/29, so perhaps User/User_talk:192.168.121.176/29 is where the notice should be posted.

Steps to reproduce problem
  1. Go to Special:InvestigateBlock
  2. For target, enter 192.168.121.180/29
  3. Add a Reason
  4. Check Leave a notice on User page and enter a message
  5. Submit

Expected behavior: The message from step 4 is on User:192.168.121.176/29, since this is the range that is actually blocked (e.g. see Special:BlockList).
Observed behavior: The message is on User:192.168.121.180/29.

Environment

Wiki(s): MediaWiki 1.36.0-alpha (ed5d593), CheckUser 2.5 (1309125).

Screenshots (if applicable):

Special:InvestigateBlock:

specialinvestigateblock_notice.png (747×740 px, 52 KB)

Notice posted on User:192.168.121.180/29:
specialinvestigateblock_notice_posted.png (130×415 px, 10 KB)

User:192.168.121.176/29 without notice:
specialinvestigateblock_notice_blockmsg.png (219×948 px, 33 KB)

Event Timeline

Change 646629 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/CheckUser@master] Normalize IP range target of block notice

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

Change 646629 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Normalize IP range target of block notice

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

dom_walden added a subscriber: STran.

We now normalise IP ranges when posting to User/User_talk pages. So, blocking 192.168.121.180/29 will leave a notice on User/User_talk:192.168.121.176/29.

This is tested for both IPv4 (thanks @STran) and IPv6.

From what I can tell, the change only affects how we normalise the titles of respective user/user_talk. It does not affect creating blocks in any way.

Just in case, though, I briefly did some regression testing of the blocking functionality of Special:InvestigateBlock. It behaves as it did before.

I notice the IP in the success message (The user 192.168.121.180/29 is now blocked) is not normalised, remains exactly as you entered it. I wonder if this should be normalised as well.

If I block several ranges which all normalise to the same range, the User/User_talk page will have multiple notices written to it. For example, blocking 192.168.121.176/29, 192.168.121.177/29 and 192.168.121.178/29 will cause the same notice to be written three times on User/User_talk:192.168.121.176/29 (if using "Append" or "Prepend"). I am not sure if this is likely to happen in practice, or whether it is a big deal even if it does.

Test environment: Local vagrant MediaWiki 1.36.0-alpha (8bbd351), CheckUser 2.5 (60b16bb).