Page MenuHomePhabricator

Add (show IP) buttons next to temporary account user name links
Closed, ResolvedPublic8 Estimated Story Points

Description

Background

For T325238, we want to allow privileged users to reveal the IP address used by a temporary account, ideally wherever a temporary account name is shown in the UI.

After T326414: Update Linker::userLink to allow identification of temporary account usernames and provide some context, we can add buttons to reveal the IP addresses anywhere a temporary account user link is shown. When clicked, the IP address(es) can be fetched via the API added in T324603: The CheckUser extension should provide IP addresses of temporary account users, for IP Masking.

There are a couple of ways to do this. One way would be to do this similarly to IPInfo, where we handle a widely-run hook like BeforePageDisplay, and add a JS module that adds the buttons, given a page and permissions check.

Designs

Some of the screenshots are old or work-in-progress, so pay attention to the bullet points too

Button:

image.png (82×836 px, 19 KB)

  • The button should be a quiet, progressive button, as in the screenshot
  • The button should appear after the user name
  • The label in English should say "Show IP" (capital "S")

Revealed IP:

image.png (802×1 px, 268 KB)

  • The revealed IP should take the place of the button
  • The IP should be surrounded by parentheses
  • If no IP is found, the parentheses should contain "unavailable" (in English)

Note that UI jumps as the buttons are added (and as the IPs are revealed) are unavoidable here, because:

  • The button labels are an unpredictable length, since they are translatable
  • The IP addresses are differing lengths
  • The string for "unavailable" is translatable, so can be different lengths
Acceptance criteria
  • Buttons should appear to users who are able to reveal IPs anywhere that temporary user account links are shown on special pages, history pages and diff pages.
  • Clicking on one button reveals one IP address
  • If a data-rev-id attribute is present in the user link, the IP address for that specific revision should be revealed (see history page example below)
  • Otherwise, the latest IP used by that user should be revealed (see Special:BlockList example below)

Note that this task does not do the following (from the parent task) - they will be covered by other tasks:

How are IPs revealed?

Two ways:

  1. Temp user reveal: On all other pages admins and checkusers will be able to reveal all IPs for a given temp account. In other words, revealing a temp account will unveil all instances of that temp account on that page irrespective of the IP address.
  2. Pair (temp user-IP) reveal: patrollers will only be able to reveal a single "temp account - IP address" pair at a time. In other words, revealing a temp account will unveil all other temp account instances on that page that are from the same IP address.

Done via T327946: Admins and checkusers unveil all IPs on the page for a temp account by clicking one button and T327947: Patrollers reveal all instances of a single IP address on a page by clicking on button

Do revealed IP addresses persist?

Yes. For admins and checkusers, all temp accounts once revealed will stay revealed even when the user moves across pages. They will stay revealed for 24 hours.
For patrollers temp-account-IP address pairs once revealed will stay revealed even when the user moved across pages. This will stay revealed for 24 hours.

Testing notes

This should be tested locally, with $wgAutoCreateTempUser['enabled'] = true; and CheckUser installed

There are various ways to test it, but some examples are below.

Example: test on a history page

  • Make edits to an article as a temporary user, using different IPs
  • Visit the article's history page as a user with the right to reveal IP addresses
  • Clicking on the "Show IP" buttons should reveal the correct IP address for each revision

Example: test on Special:BlockList

  • Block some temporary users
  • Visit Special:BlockList
  • Clicking on the "Show IP" buttons should reveal the latest IP used by each user

Related Objects

Event Timeline

Tchanders set the point value for this task to 8.

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

[mediawiki/extensions/CheckUser@master] WIP Add buttons for showing IP addresses next to temporary account user links

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

Change 877246 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add buttons for showing IP addresses next to temporary account user links

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

@Tchanders Besides the tickets that were created from T326695: Table of contents appears as "undefined", T326696: User options supplied to client side empty due to json encoding errors (multibyte character cut in half), T326697: Harden API Gateway in preparation for RESTbase deprecation service migration and T326692: Reference previews should use Popups registration. I do have a couple of questions about a couple of things I came across as seen in the screenshots.

Skins: Vector 2022, Vector 2010, Timeless. MonoBook, Minerva
OS: macOS 13.0

Browsers: Chrome 109, Safari 16, FireFox 109

Environment: Local

Tested
Special:Preferences#mw-prefsection-rc (check vs uncheck)
User: Admin & Non-Admin
Suppress Visibility Restrictions
a. Revision text
b. Edit Summary
c. Editor's username/IP address
d. Suppress data from administrators as well as others
Global Blocking
Sitewide Blocking
Partial Blocking

Special:CheckUser - When you look under as a Non-Admin, you can see the IP addresses on the temp user account, just like an Admin.
Non-Admin

T326415_ IPMasking_TempAccount_SpecialCheckUser_NA.png (1×3 px, 329 KB)

Admin
T326415_ IPMasking_TempAccount_SpecialCheckUser_A.png (1×3 px, 329 KB)

IPInfo- It says no edits have been made under 103.130.145.255 but that's one of the addresses I used to edit with a temp account.

T326415_ IPMasking_TempAccount_SpecialContributions.png (834×3 px, 204 KB)

PartialBlocking. This shouldn't matter since this does not affect viewing. Only sitewide and Global Block are the only ones that would affect ShowIP, right?

T326415_ IPMasking_TempAccount_PartialBlocking_NA.png (721×1 px, 140 KB)

This is intentional for Special:CheckUser (and Special:Investigate). Non-admin checkusers are already able to see registered account IP addresses, and IMO the IP address of a registered account is more of a security risk than a temporary account. See T325238#8504004.

Regarding the partial blocks, I think that the action of showing an IP address for a temporary user should respect partial blocks. If the user is not trusted enough to edit a given page or namespace, then I don't see why they should be able to see temporary user's IPs for those pages or namespaces.

For example, a user A could be "edit-warring" with a temporary account B on article X and be partially blocked for it. Without respecting partial blocks user A could then access B's IP address, and the only way to avoid this would be to remove the temporary account IP viewing rights or using a full block. Removing rights or using a full block may be seen as an over-reaction by the administrator who partially blocked, especially if the block is short and limited to one page.

While a user trusted with this right should never abuse it, I think it's better to protect against this possibility. Considering the log is going to be fairly restricted, there would be no way for an administrator to know if a partially blocked user did this.

Special:CheckUser - When you look under as a Non-Admin, you can see the IP addresses on the temp user account, just like an Admin.

As @Dreamy_Jazz says, this is fine - if you have the 'checkuser' right you can see everything on CheckUser.

Show IP buttons shouldn't be seen on Special:CheckUser or Special:Investigate, since the IPs are already visible.

IPInfo- It says no edits have been made under 103.130.145.255 but that's one of the addresses I used to edit with a temp account.

Special:Contributions page says "No changes were found" so there's no problem with IPInfo specifically. If there was a list of changes on the page, but we had an IPInfo error saying that no changes had been found, that would indicate a problem.

If I've understood correctly what you've done, then the reason no contributions are shown here is because Special:Contributions for an IP address won't show which contributions were made by temporary accounts who used that IP address. That's because it would leak the IP addresses of those users to everyone (since everyone can see Special:Contributions.) Once IP Masking is enabled, Special:Contributions for an IP address will only show historical edits made by anon users from before IPs were masked. @Niharika should we add some messaging on these pages to explain this?

I wouldn't expect to see Show IP buttons on Special:Contributions pages for temporary account users until T326394: IP Address Reveal on Contributions page. There are no temporary user name links on the page, so we will be adding them separately. (At the moment we only add the, next to temporary user links.)

PartialBlocking. This shouldn't matter since this does not affect viewing. Only sitewide and Global Block are the only ones that would affect ShowIP, right?

Not sure I 100% understand the question, so I'll just state a few things about blocks! Let me know if I haven't answered it...

  • On Special:Block itself, we will be revealing the IP addresses used by the temporary account user, to the blocking admin (see T324602: SpecialBlock: Once a temporary account is selected, below the username field display IP addresses associated with the account). We would show these whether the block being made is partial or sitewide
  • On Special:BlockList, the latest IP should be revealed next to the blocked temporary account user's name, whether partial or sitewide blocked
  • Should a partially blocked user be able to reveal IP addresses? We currently don't allow partially blocked users to reveal IP addresses anywhere. This point hasn't actually been decided in the product spec though. @Niharika what do you think? See also the comment above (T326415#8605235) on how this could behave.

Thanks for the information @Dreamy_Jazz with CheckUser!

@Tchanders

Special:Contributions page says "No changes were found" so there's no problem with IPInfo specifically. If there was a list of changes on the page, but we had an IPInfo error saying that no changes had been found, that would indicate a problem.

I see, that makes sense.

On Special:Block itself, we will be revealing the IP addresses used by the temporary account user, to the blocking admin (see T324602: SpecialBlock: Once a temporary account is selected, below the username field display IP addresses associated with the account). We would show these whether the block being made is partial or sitewide

I got it, thanks!

On Special:BlockList, the latest IP should be revealed next to the blocked temporary account user's name, whether partial or sitewide blocked

Sorry if I'm not following but are you saying that the IP address should show up next to the temp account user's name in the Special:BlockList? That means in the screenshot below, I should have seen an IP address next to the username?

Admin

T326415_ IPMasking_TempAccount_SpecialBlockList_A.png (1×3 px, 268 KB)

Admin that's partially blocked
T326415_ IPMasking_TempAccount_SpecialBlockList_NA.png (1×3 px, 292 KB)

  • Should a partially blocked user be able to reveal IP addresses? We currently don't allow partially blocked users to reveal IP addresses anywhere. This point hasn't actually been decided in the product spec though. @Niharika what do you think? See also the comment above (T326415#8605235) on how this could behave.

I have seen situations where a otherwise constructive editor is partially blocked to prevent re-occurring issues and accessing IP addresses would be fine for that user in every place except related to their block. However, if it's not worth the overhead (code and time to check) then I think simply not allowing if any block is active would be fine.

Sorry if I'm not following but are you saying that the IP address should show up next to the temp account user's name in the Special:BlockList? That means in the screenshot below, I should have seen an IP address next to the username?

Yes, that's right, like this:

image.png (152×895 px, 20 KB)

Looking at your Special:Block screenshots, I can't see a temporary user name (unless you've changed the default config, the name should begin with * Unregistered)

Sorry if I'm not following but are you saying that the IP address should show up next to the temp account user's name in the Special:BlockList? That means in the screenshot below, I should have seen an IP address next to the username?

Yes, that's right, like this:

image.png (152×895 px, 20 KB)

@Tchanders Got it. Show IP is displayed and works as designed on Special:BlockList, as seen in the screenshot below. Sounds good, I'll move this to Done. Thanks again and thanks @Dreamy_Jazz for the info!

T326415_IPMasking_TempAcct_BlockList.png (830×3 px, 259 KB)

Special:Contributions page says "No changes were found" so there's no problem with IPInfo specifically. If there was a list of changes on the page, but we had an IPInfo error saying that no changes had been found, that would indicate a problem.

If I've understood correctly what you've done, then the reason no contributions are shown here is because Special:Contributions for an IP address won't show which contributions were made by temporary accounts who used that IP address. That's because it would leak the IP addresses of those users to everyone (since everyone can see Special:Contributions.) Once IP Masking is enabled, Special:Contributions for an IP address will only show historical edits made by anon users from before IPs were masked. @Niharika should we add some messaging on these pages to explain this?

I think this should be covered through documentation in project pages and other channels. Maybe we could do short-term banners to make this more explicit when we roll out the change. Over time this should be naturally understandable, especially as links to Special:Contributions for IP addresses will dwindle from interfaces.
About the specific message shown with IP Info - maybe we can improve that to include some more information about what's going on. I'll consult on this with @Prtksxna.

  • Should a partially blocked user be able to reveal IP addresses? We currently don't allow partially blocked users to reveal IP addresses anywhere. This point hasn't actually been decided in the product spec though. @Niharika what do you think? See also the comment above (T326415#8605235) on how this could behave.

I have seen situations where a otherwise constructive editor is partially blocked to prevent re-occurring issues and accessing IP addresses would be fine for that user in every place except related to their block. However, if it's not worth the overhead (code and time to check) then I think simply not allowing if any block is active would be fine.

Hmm, this is interesting. We have not defined this in the product spec yet but I will add this to my list of decisions we need to make. Thanks for flagging it.