Page MenuHomePhabricator

Collect browser "client hints" when user submits a vote
Open, Needs TriagePublic

Description

Since there are some important elections scheduled soon on votewiki (in particular ACE 2023 and U4C Charter), before these starts there are some days without any election on votewiki.

If possible, it would be very useful for scrutineers to have votewiki collect client hints data (e.g. to more easily find abusive votes). Those days would be ideal (around mid-November) because there is no risk of breaking anything during the elections, but in case, this functionality would be very useful even afterwards. If possible I'd ask you to work on this task. Many thanks!

Event Timeline

Adding also @jrbs who deals with votewiki/securepoll and whose opinion on the matter would be really useful imho!

Dreamy_Jazz renamed this task from Deploy client hints functionality on votewiki to Collect client hints for votes using SecurePoll on votewiki.Oct 29 2023, 8:57 PM

A quick inspection of the code suggests that the SecurePoll code does not rely on the CheckUser extension, with the SecurePoll extension itself storing the data in it's own database tables.

The database structure that stores client hints in CheckUser does not support storing data for other extensions. While it may be possible to add this, I think it would be cleaner and easier to implement the storage in the SecurePoll extension without depending on the CheckUser extension. This will lead to some duplication between the extensions (in terms of code), but would avoid making SecurePoll depend on CheckUser.

I'm therefore removing the parent task of CheckUser extension related work for implementing Client Hints.

Discussed potential implementation methods and we decided that integration with CheckUser is the easiest to achieve.

SecurePoll collects its own voter personal information without any dependency on CheckUser. It stores this data in securepoll_votes.vote_ip, securepoll_votes.vote_xff, and securepoll_votes.vote_ua. To overhaul the existing system as little as possible, I'd recommend implementing this by adding the SQL column securepoll_votes.vote_ch. I would expect the acceptance criteria to be something like...

  • patch to add securepoll_votes.vote_ch SQL field
  • deploy new field to Wikimedia production. (SecurePoll is installed on like 1000 wikis, so lots of ALTER TABLES to do)
  • code the submit vote form processor to collect client hints and write it to the SQL database.
  • code the list page to add a column displaying the client hints to folks with user right securepoll_view_voter_pii
  • code the vote details page to add a row displaying the client hints to folks with user right securepoll_view_voter_pii
Novem_Linguae renamed this task from Collect client hints for votes using SecurePoll on votewiki to Collect browser "client hints" when user submits a vote.Jun 26 2025, 5:22 AM

SecurePoll collects its own voter personal information without any dependency on CheckUser. It stores this data in securepoll_votes.vote_ip, securepoll_votes.vote_xff, and securepoll_votes.vote_ua. To overhaul the existing system as little as possible, I'd recommend implementing this by adding the SQL column securepoll_votes.vote_ch. I would expect the acceptance criteria to be something like...

  • patch to add securepoll_votes.vote_ch SQL field
  • deploy new field to Wikimedia production. (SecurePoll is installed on like 1000 wikis, so lots of ALTER TABLES to do)
  • code the submit vote form processor to collect client hints and write it to the SQL database.
  • code the list page to add a column displaying the client hints to folks with user right securepoll_view_voter_pii
  • code the vote details page to add a row displaying the client hints to folks with user right securepoll_view_voter_pii

Alternatively, you could add a soft dependency on CheckUser for this specific feature, and then you can re-use a bunch of infrastructure for server-side/client-side collection. Loading the data on the list page could pull from CheckUser client hints tables.

I also think this feature may need Legal review before it can proceed (cc @MMoss_WMF @Niharika)

Noting for the record that if SecurePoll implements client-hint-collection itself, it might be worth putting its collection behind a config variable, and then making a separate patch to Catalyst (PatchDemo) to set that new config variable to false; or having some other way to be able to prevent that info from reaching MediaWiki on the Patch Demo side of things. cf. T385156#10706944