Page MenuHomePhabricator

IP auto-reveal: Limit the duration that auto-reveal mode can be extended for
Closed, ResolvedPublic

Description

Summary

Users can extend the duration for IP auto-reveal, by adding 10 minutes.

Since the tool is exposing private data, there should be an upper limit to how long auto-reveal can be on for, to ensure that it is only used when needed.

Design

image.png (1,688×584 px, 195 KB)

image.png (1,720×998 px, 499 KB)

Error message:

The duration cannot be set to more than 24 hours

Acceptance criteria

  • IP auto-reveal expiry can not be set to greater than 24 hours from the time when it is set

Event Timeline

@KColeman-WMF @Niharika This was proposed in the engineering meeting as a mitigation to someone writing a script that sets the expiry time very far in the future. Does it seem OK with you?

@KColeman-WMF @Niharika This was proposed in the engineering meeting as a mitigation to someone writing a script that sets the expiry time very far in the future. Does it seem OK with you?

Yes, I like the idea of including this mitigation.

@KColeman-WMF Here's a screenshot of error when the user attempts to extend the duration too far:

image.png (1,330×657 px, 59 KB)

How does that look?

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

[mediawiki/extensions/CheckUser@master] WIP IP auto-reveal: Limit how long the expiry can be extended

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

@KColeman-WMF Here's a screenshot of error when the user attempts to extend the duration too far:

image.png (1,330×657 px, 59 KB)

How does that look?

Thanks @Tchanders. I've tweaked the copy slightly but otherwise it looks good to me!

New copy: The duration cannot be set to more than 24 hours

image.png (1,688×584 px, 195 KB)

Note: the same error will display on the panel if the user exceeds the 24 hour duration limit.

image.png (1,720×998 px, 499 KB)

Change #1139477 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IP auto-reveal: Limit how long the expiry can be extended

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

Needs another patch to handle expiry times that are set directly via the API to more than 24 hours in the future.

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

[mediawiki/extensions/CheckUser@master] IP auto-reveal: Limit the maximum valid duration

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

Change #1142153 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IP auto-reveal: Limit the maximum valid duration

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

Testing notes

See T386500#10708399 for general testing steps for IP auto-reveal.

Some helpful-to-know context:

  • IP auto-reveal can be enabled via the link in the toolbar, but since it is a Global Preference, it can also be enabled by setting the preference directly.

Auto-reveal cannot be extended more than 24 hours via the UI:

  • Log in as a user who can auto-reveal IPs
  • Set the expiry to almost 24 hours from now. E.g.:
    • Paste Math.round( Date.now() / 1000 + 86400 - 500 ) into your browser console. The result is a timestamp just less than 24 hours in the future.
    • Set this value as your auto-reveal expiry, e.g. by visiting Special:ApiSandbox and filling out action=globalpreferences, optionname=checkuser-temporary-account-enable-auto-reveal, optionvalue=<the timestamp>
  • Visit a page with temporary accounts IPs, e.g. a history page. They should be visible.
  • Click on the auto-reveal tool link in the sidebar. The dialog should say you have just under 24 hours remaining.
  • Click on the "+10 min" button. If 10 more minutes takes your expiry beyond 24 hours in the future, you should see an error message. (Otherwise repeat this step until clicking on +10 takes your expiry beyond 24 hours.)

If auto-reveal expiry is set to more than 24 hours in the future via the API, it should be unset the next time it is checked:

  • Log in as a user who can auto-reveal IPs
  • Set the expiry to beyond 24 hours from now. E.g.:
    • Paste Math.round( Date.now() / 1000 + 86400 + 1000 ) into your browser console. The result is a timestamp over 24 hours in the future.
    • Set this value as your auto-reveal expiry, e.g. by visiting Special:ApiSandbox and filling out action=globalpreferences, optionname=checkuser-temporary-account-enable-auto-reveal, optionvalue=<the timestamp>
  • Visit a history page on your wiki (this should trigger a lookup to the preference, which should find the invalid preference and unset it). You should find that IP auto-reveal mode is now switched off.
Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected (Auto-reveal cannot be extended more than 24 hours via the UI... If Auto-reveal expiration is set to more than 24 hours in the future via the API: it will Turn Off the IP Auto-reveal, and the Show IP button will be displayed / IP Address will not be displayed ). Outstanding Testing Notes @Tchanders, Thank You.