Page MenuHomePhabricator

CVE-2025-62661: UserInfoCard: Do permission checking when getting counts of global and local edits, new articles and thanks
Closed, ResolvedPublic1 Estimated Story PointsSecurity

Description

The counts for some data points include edits/actions which the user does not have permission to see.

These include:

  • totalEditCount
  • thanksGiven
  • thanksReceived
  • newArticlesCount
  • globalEditCount
  • revertedEditCount (I will need to verify this)

I will need to follow up on whether this affects the other data points (e.g. block counts, checkuser counts, etc.)

Reproduction
  1. Create a new user
  2. As that new user:
    1. edit an existing page
    2. create a new page
    3. thank another user (e.g. in the revision history page)
  3. Login as an admin
    1. thank the new user for one of their edits
    2. revert their edit from step 2a.
    3. Go to Special:Contributions/<new user> and for each contribution suppress its visibility (click "change visibility" and check all of the checkboxes)
    4. Go to Special:Log/thanks and change the visibility of the thanks given/received in steps 2c and 3a
  4. Login as a normal user with no elevated rights
  5. Enabled with UserInfoCard by submitting: Special:ApiSandbox#action=options&format=json&optionname=checkuser-userinfocard-enable&optionvalue=1
  6. Go to Special:ListUsers?username=<new user> and click the UserInfoCard icon next to <new user>

Expected: all the counts for "Global edits", "Local edits", "reverted", "New articles" and "Thanks received/given" to be zero.
Actual: those counts are non-zero. If you click their respective links you will not be able to see any of the edits/actions which UIC reports.

Event Timeline

dom_walden renamed this task from UserInfoCard: Do permission checking when getting counts of gobal and local edits, new articles and thanks to UserInfoCard: Do permission checking when getting counts of global and local edits, new articles and thanks.Jun 20 2025, 6:54 AM
dom_walden added subscribers: kostajh, Tchanders, Dreamy_Jazz and 5 others.
sbassett subscribed.

Leaving to Trust and Safety Product Team unless there is a specific ask of the Security Team here.

thanksGiven and thanksReceived are from ThanksQueryHelper in Thanks, so tagging that extension.

globalEditCount is from MediaWiki-extensions-CentralAuth getGlobalEditCount, so tagging that extension here too.

totalEditCount is from UserEditTracker in core -> MediaWiki-User-management

newArticlesCount and revertedEditCount this is from GrowthExperiments

Out of those numbers, only thanksGiven/Received and newArticlesCount/revertedEditCount are dynamically calculated. The edit counts are implemented by bumping a counter, so I don't think we can/should do much there – it is a widely known fact the edit counter does not always represent what you see in Special:Contributions.

OK, what I think we (Trust and Safety Product Team) should do for UserInfoCard:

  • Update ThanksQueryHelper to only include log_deleted = 0 in its queries. If someone in the future wants to include support for adding an Authority to include counts based on suppressed log entries, that would be fine, but I dont' think we need to do it now. On enwiki, out of 4,259,843 log entries for thanks, only 469 are suppressed.
  • newArticlesCount - we can update ComputedUserImpactLookup#getCreatedArticleCount in GrowthEpxeriments to check that log_deleted is 0

What I propose we don't do anything about:

  • As @Urbanecm_WMF notes above: both methods in CentralAuth for calculating edit counts don't take into account the authority that is checking the count, and the edit tracker in core doesn't do that either. I propose that we leave this as a "won't fix".
  • revertedEditCount already checks for rev_deleted ($queryBuilder->where( $db->bitAnd( 'rev_deleted', RevisionRecord::DELETED_USER ) . ' = 0' );), so I think there is nothing more to be done there.
kostajh set the point value for this task to 1.Jul 23 2025, 10:58 AM
mszwarc changed the task status from Open to In Progress.Jul 29 2025, 10:50 AM
mszwarc claimed this task.

OK, what I think we (Trust and Safety Product Team) should do for UserInfoCard:

  • Update ThanksQueryHelper to only include log_deleted = 0 in its queries. If someone in the future wants to include support for adding an Authority to include counts based on suppressed log entries, that would be fine, but I dont' think we need to do it now. On enwiki, out of 4,259,843 log entries for thanks, only 469 are suppressed.
  • newArticlesCount - we can update ComputedUserImpactLookup#getCreatedArticleCount in GrowthEpxeriments to check that log_deleted is 0

Here are patches for GrowthExperiments and Thanks to address these two points:

+2, I've reviewed both patches and they look ok for me

OK, what I think we (Trust and Safety Product Team) should do for UserInfoCard:

  • Update ThanksQueryHelper to only include log_deleted = 0 in its queries. If someone in the future wants to include support for adding an Authority to include counts based on suppressed log entries, that would be fine, but I dont' think we need to do it now. On enwiki, out of 4,259,843 log entries for thanks, only 469 are suppressed.
  • newArticlesCount - we can update ComputedUserImpactLookup#getCreatedArticleCount in GrowthEpxeriments to check that log_deleted is 0

Here are patches for GrowthExperiments and Thanks to address these two points:

Deployed

Given the comment in T402600#11119989, would it be fine to upload these changes to Gerrit as well for Thanks and GrowthExperiments? And, in that vein, what would be the process to make this task itself public?

Given the comment in T402600#11119989, would it be fine to upload these changes to Gerrit as well for Thanks and GrowthExperiments? And, in that vein, what would be the process to make this task itself public?

ext:Thanks is actually bundled since 1.40. So we'd want to keep that one tracked and embargoed until the upcoming core security release (T397766, due out towards the end of September 2025). The ext:GrowthExperiments patch would be fine to push up to gerrit, especially if it's causing conflicts with other, public work, but this task should remain protected until the aforementioned core security release is out. I've added @gerritbot as a subscriber to this task, so if you do push the ext:GrowthExperiments patch up to gerrit, it should still post the changes here.

Change #1189190 had a related patch set uploaded (by Reedy; author: Mszwarc):

[mediawiki/extensions/GrowthExperiments@master] SECURITY: Exclude deleted log entries when counting created articles

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

Change #1189190 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] SECURITY: Exclude deleted log entries when counting created articles

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

Change #1189252 had a related patch set uploaded (by Reedy; author: Mszwarc):

[mediawiki/extensions/GrowthExperiments@REL1_44] SECURITY: Exclude deleted log entries when counting created articles

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

Change #1189252 abandoned by Reedy:

[mediawiki/extensions/GrowthExperiments@REL1_44] SECURITY: Exclude deleted log entries when counting created articles

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

Reedy renamed this task from UserInfoCard: Do permission checking when getting counts of global and local edits, new articles and thanks to CVE-2025-61654: UserInfoCard: Do permission checking when getting counts of global and local edits, new articles and thanks.Sep 29 2025, 1:40 PM

Change #1193240 had a related patch set uploaded (by Reedy; author: Mszwarc):

[mediawiki/extensions/Thanks@REL1_44] SECURITY: Exclude deleted entries when counting thanks

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

Change #1193240 merged by jenkins-bot:

[mediawiki/extensions/Thanks@REL1_44] SECURITY: Exclude deleted entries when counting thanks

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

Change #1193250 had a related patch set uploaded (by Reedy; author: Mszwarc):

[mediawiki/extensions/Thanks@master] SECURITY: Exclude deleted entries when counting thanks

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

Change #1193250 merged by jenkins-bot:

[mediawiki/extensions/Thanks@master] SECURITY: Exclude deleted entries when counting thanks

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

Change #1193431 had a related patch set uploaded (by Reedy; author: Mszwarc):

[mediawiki/extensions/Thanks@REL1_43] SECURITY: Exclude deleted entries when counting thanks

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

Change #1193431 merged by jenkins-bot:

[mediawiki/extensions/Thanks@REL1_43] SECURITY: Exclude deleted entries when counting thanks

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

Mstyles renamed this task from CVE-2025-61654: UserInfoCard: Do permission checking when getting counts of global and local edits, new articles and thanks to CVE-2025-62661: UserInfoCard: Do permission checking when getting counts of global and local edits, new articles and thanks.Tue, Oct 21, 7:34 PM
sbassett changed Author Affiliation from N/A to WMF Product.
sbassett removed a project: Patch-For-Review.
sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to High.