Page MenuHomePhabricator

REST API requests for temporary account IPs are made multiple times for the same revision IDs
Closed, ResolvedPublicBUG REPORT

Description

The CheckUser extension allows lookup of temporary account IP addresses using REST APIs. However, when the same temporary account has made more than one edit the REST API allows specifying more than one revision ID for the lookup of IPs.

When these REST API calls are made, the code incorrectly makes the request the number of times equal to the number of edits made by the temporary account.

Steps to replicate the issue
  1. Make a number of edits to a page using a temporary account (at least more than one edit)
  2. Log into an account with the checkuser-temporary-account right
  3. Open the developer console (F12)
  4. Reveal the IP addresses for the temporary account you used to make the edits in step 1

What happens?:
Multiple requests for the same revision ID are shown in the console which all have the same response JSON.

What should have happened instead?:
Either a separate request should be made for each revision ID or only one request should have been made.

Example screenshot

image.png (159×1 px, 29 KB)

Event Timeline

The IP reveal JS code also seems to have a bug where multi-reveal will not work properly if content is added via the wikipage.content hook.

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

[mediawiki/extensions/CheckUser@master] WIP IP reveal: Stop performing duplicate API requests for temp user IPs

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

Change #1052315 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IP reveal: Stop performing duplicate API requests for temp user IPs

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

QA can follow the steps to reproduce, and you can test this on patch demo or a local wiki.

Change #1053044 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Use ::next instead of ::siblings to prevent more than one reveal

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

Change #1053044 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Use ::next instead of ::siblings to prevent more than one reveal

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

Djackson-ctr subscribed.

I have verified the new code has been implemented and is functioning and displaying as expected.

image.png (33×1 px, 3 KB)