Page MenuHomePhabricator

Blocked users should not be allowed to view IP addresses
Closed, ResolvedPublic

Description

Motivation

When a user is site-wide blocked, they are not allowed to use the IP reveal and IP Info tools (see T375086 and T385429). We should provide a user-friendly message to indicate their lack of access instead showing no "Show IP" button.

User story

As a blocked editor with the temporary account IP reveal feature enabled, I want to understand why IP reveal no longer works for me.

Specs
  • This should be a per-wiki setting. A user should not be able to view IPs on the wiki they are blocked but if they are not blocked on another wiki where they qualify to view IPs, that access should not change.
  • Only sitewide blocked users should be blocked from viewing IPs. See T385429: Temp Accounts: Only sitewide blocks should block IP Reveal access.
  • When the block expires or is revoked, the access is restored as previously.
Mocks

History / Recent Changes / Log etc. pages
Blocked editor clicks IP reveal and sees message explaining why they are blocked

1. History.png (1×1 px, 196 KB)

Note: The copy for the popup is based on the notice that appears when a blocked editor tries to edit a wiki page.

Event Timeline

Niharika triaged this task as Medium priority.

Note that a user could be blocked on some wikis but not others, so may be confused as to why they're only sometimes able to reveal IPs

@Niharika are the designs and business rules for this up to date? Should we do this as part of the current round of IPInfo work?

Tchanders changed the task status from Open to Stalled.Nov 25 2024, 2:48 PM

@Niharika are the designs and business rules for this up to date? Should we do this as part of the current round of IPInfo work?

Just discussed with @Niharika . This is stalled on reviewing the specs.

@KColeman-WMF I've updated this task to be limited to sitewide blocks only, per our conclusion with Legal.
I'm wondering if the info icon will be confusing to use here because it is usually used for IP Info.

@KColeman-WMF I've updated this task to be limited to sitewide blocks only, per our conclusion with Legal.
I'm wondering if the info icon will be confusing to use here because it is usually used for IP Info.

The idea is to be consistent and display a message in the same component that the blocked user no longer has permission to see. We could make the copy more explicit: "You do not have permission to reveal IP addresses for the following reason."

Niharika changed the task status from Stalled to Open.Feb 4 2025, 10:53 AM

@KColeman-WMF I've updated this task to be limited to sitewide blocks only, per our conclusion with Legal.
I'm wondering if the info icon will be confusing to use here because it is usually used for IP Info.

The idea is to be consistent and display a message in the same component that the blocked user no longer has permission to see. We could make the copy more explicit: "You do not have permission to reveal IP addresses for the following reason."

Oh, I see. That makes sense. I think the existing copy is fine unless you think it needs to be changed.

In T345639#10520354, @Niharika wrote:

Oh, I see. That makes sense. I think the existing copy is fine unless you think it needs to be changed.

Yes I think we can keep the copy as it is.

Niharika renamed this task from Blocked users should not be allowed to view IP addresses [WIP] to Blocked users should not be allowed to view IP addresses.Feb 4 2025, 1:24 PM
Dreamy_Jazz subscribed.

I'm going to look at taking this one on. Some of the work may be blocked on syncing IP Info permissions (like T373818), but should be possible to work on the overall dialog.

Looking at this further, it seems that when sitewide blocked the Show IP button is not displayed and IP reveal code is not loaded. However, the IP Info code is loaded and the info icon is shown when the user is sitewide blocked.

Therefore, my approach to the first point in the task will be to implement this notice in IP Info so that I can re-use the existing information icon and related pop-up code. This will be defined in an IP Info way (i.e. messages about IPInfo), but then overridden on WMF wikis to use the messages defined in the design. I don't think it would be particularly useful to implement this dialog in both CheckUser and IP Info so that third-party wikis without CheckUser can have this.

For the second point, the popup will need to be implemented in CheckUser but I will need to clarify the requirements for this further.

After discussing the specs with @KColeman-WMF, we have decided to remove the specifications related to showing the notice on Special:Preferences. This is due to the additional technical complications related to MediaWiki-extensions-GlobalPreferences and storing the checked state of the checkbox for restoration after their site-wide block is removed.

Access to the tool will remain not possible for site-wide blocked users, but they will be able to check and uncheck the preference while site-wide blocked. This is okay because we define the site-wide blocked check directly without the use of the preference, so checking or unchecking the preference while site-wide blocked does not cause any change to the level of access a user has to the tools.

Having discussed this with @Dreamy_Jazz - we agreed that for instances where there is no username displayed, we should display a disabled "Show IP" button with the info icon to launch the popover. This is so that the user makes the connection between the info icon and Show IP, as when there is no temporary account displayed the connection is unclear.

IP-reveal-blocked.png (2×6 px, 1 MB)

Change #1132662 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] Render disabled "Show IP" buttons for blocked users

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

Change #1133165 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] phpunit: Combine PageDisplay tests

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

Change #1134278 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[integration/config@master] zuul: Test IPInfo with MobileFrontend

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

Change #1134305 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/IPInfo@master] phpunit: Convert PopupHandlerTest into a unit test

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

Change #1134306 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/IPInfo@master] popup: Skip rendering for blocked users with IP reveal

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

Change #1134307 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] Add API module to retrieve formatted block info

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

Change #1133165 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] phpunit: Combine PageDisplay tests

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

Change #1134307 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add API module to retrieve formatted block info

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

Change #1134278 merged by jenkins-bot:

[integration/config@master] zuul: Test IPInfo with MobileFrontend

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

Change #1135979 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[integration/config@master] zuul: Add phan dependency for IPInfo with MobileFrontend

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

Change #1135979 merged by jenkins-bot:

[integration/config@master] zuul: Add phan dependency for IPInfo with MobileFrontend

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

Change #1134305 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] phpunit: Convert PopupHandlerTest into a unit test

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

Change #1134306 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] popup: Skip rendering for blocked users with IP reveal

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

Change #1132662 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Render disabled "Show IP" buttons for blocked users

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

Change #1139014 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] specials: Update ShowIPButton component to display block information

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

Change #1139015 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] Sync BlockDetailsPopupButtonWidget with ShowIPButton

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

Change #1139014 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] specials: Update ShowIPButton component to display block information

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

Change #1139015 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Sync BlockDetailsPopupButtonWidget with ShowIPButton

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

QA Notes
Make sure you have the CheckUser and IPInfo extensions installed and that your test account has both IP reveal permissions and IPInfo data access as well as access to Special:Block.
Additionally, set $wgUseCodexSpecialBlock = true; in LocalSettings.php.

  • Issue a sitewide block targeting this test account (trivially can be a self-block).
  • Verify that IP reveal buttons in page histories and other pagers are disabled, and the information icon next to them shows formatted block details when clicked, as specified.
  • Verify that going to Special:Block and inputting a temporary account user name into the target input field will likewise cause a disabled Show IP button to be shown, with an information icon that also shows block details in a popup.
  • Verify that being partially blocked does not prevent access to IP reveal.
Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected (Sitewide Blocked Users: will see the Show IP buttons disabled/greyed out, and when the Blocked User clicks the information icon it will list details regarding the block... Partially Blocked Users: will be able to see the Show IP buttons enabled/not greyed out, and when the Partially Blocked User clicks that button it will show the IP). Thank you for the QA Notes @mszabo, much appreciated sir.