Page MenuHomePhabricator

Limit the ability for other users after the fact storing client hints data using the REST API
Closed, ResolvedPublic

Description

When an anon user edits and either uses a browser that does not support client hints or blocks the REST API URL manually, the client hints data is never stored. This means that any other user connecting through this IP address could store arbitrary client hints data for this action, by sending a request to the API.

While this is unlikely to happen, it should be guarded against where possible. This should be done by limiting the time that a user who is allowed to make the API request can have to submit the data. In all cases where the submission is caused by an edit, this will be made moments after. However, in the case of manual experimentation, this could be done hours later.

The cut-off should account for users on slow internet connections and therefore should be set to give enough time to make the request.

Thanks to @dom_walden for spotting this.

Acceptance critera
  • Limit the time period that another user could submit client hints data if the user making the edit blocks the client hints API url.

Event Timeline

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

[mediawiki/extensions/CheckUser@master] Prevent saving Client Hints using REST API when action is too old

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

Change 941936 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Prevent saving Client Hints using REST API when action is too old

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

@Dreamy_Jazz During this time period, it is able to collect client hint data. After the time period is over, it's saying the revision is too old to record client hint data. Is that what it's supposed to look like when the time period is over?

Before PatchAfter Patch
T342134_CheckUser_ClientHintTimePeriod_BP.png (182×2 px, 52 KB)
T342134_CheckUser_ClientHintTimePeriod_AP.png (233×2 px, 95 KB)

@Dreamy_Jazz Thanks for validating and I will move this to Done. Thanks again for your work!

Noting that there are three instances of "The revision {id} is too old to allow recording client hints data" in Logstash, on three different wikis. We can keep an eye on this when we start collecting data on group2 wikis.

Noting that there are three instances of "The revision {id} is too old to allow recording client hints data" in Logstash, on three different wikis. We can keep an eye on this when we start collecting data on group2 wikis.

Thanks for noting this.