Page MenuHomePhabricator

CVE-2024-40607: Special:CheckUser 'Get actions' page link can expose the username of a suppressed user via the 'logs' URL
Closed, ResolvedPublic2 Estimated Story PointsSecurity

Description

When using Special:CheckUser for a Get actions check and the current authority does not have the permission to see suppressed content, then a user who was blocked with hideuser enabled can see the username of the suppressed user by looking at the link URL provided for the logs link.

Examples:

Leak via a logout eventLeak via a block log entry
image.png (652×2 px, 300 KB)
image.png (618×2 px, 278 KB)
Steps to reproduce
  1. Add $wgCheckUserLogLogins = true; to LocalSettings.php if using a local wiki to test. Production has this set this value, so ignore if testing on production.
  2. Create a new account
  3. Logout of this account and log into account with the suppressor group
  4. Block the account created in step 2 with hideuser (Hide username from edits and lists) checked
  5. Log into an account without the suppressor group but with the checkuser group
  6. Run a check on the IP address used to create the account in step 2
  7. Find the entry with the username as (username removed) and the event as a logout event
  8. Hover over the logs link and notice that it shows the username that is hidden from the current user
  9. Find the entry for the block of the account created in step 2
  10. Hover over the logs link and notice that it shows the username that is hidden from the current user

Event Timeline

Dreamy_Jazz renamed this task from Special:CheckUser 'Get actions' page link can expose the username of a suppressed user for login and logout events to Special:CheckUser 'Get actions' page link can expose the username of a suppressed user via the 'logs' URL.Apr 1 2024, 3:49 PM
Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz updated the task description. (Show Details)

Very simple approach. Not sure if it actually does cover all cases. Also it might be to harsh for some cases.

Very simple approach. Not sure if it actually does cover all cases. Also it might be to harsh for some cases.

-1. This isn't the optimal solution IMO. We still want to display the diff links so that the checkuser can look at the edit in Special:Diff. Furthermore, if the username used as the title for the event isn't the performer (for example a block log) then this wouldn't appropriately hide the username.

I will upload my suggested version shortly (as I've been working on one for the last few mins).

My proposed patch to fix this:

This (compared to the other patch) will:

  • Hide a username defined as the page for the logs link if the username isn't the performer of the action but it still hidden
  • Will also check if the username is hidden for the specific log event (by checking log_deleted)

My proposed patch to fix this:

This (compared to the other patch) will:

  • Hide a username defined as the page for the logs link if the username isn't the performer of the action but it still hidden
  • Will also check if the username is hidden for the specific log event (by checking log_deleted)

Looks good: +2.

This should be deployed to production.

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

[mediawiki/extensions/CheckUser@master] SECURITY: Hide 'logs' link if page is a hidden user in 'Get actions'

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

Change #1016826 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] SECURITY: Hide 'logs' link if page is a hidden user in 'Get actions'

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

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

[mediawiki/extensions/CheckUser@REL1_41] SECURITY: Hide 'logs' link if page is a hidden user in 'Get actions'

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

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

[mediawiki/extensions/CheckUser@REL1_40] SECURITY: Hide 'logs' link if page is a hidden user in 'Get actions'

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

Change #1016784 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_41] SECURITY: Hide 'logs' link if page is a hidden user in 'Get actions'

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

mmartorana changed the task status from Open to In Progress.Apr 4 2024, 2:24 PM
mmartorana triaged this task as Low priority.

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

[mediawiki/extensions/CheckUser@REL1_41] Follow-up fix to 'Get edits' security fix

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

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

[mediawiki/extensions/CheckUser@REL1_39] SECURITY: Hide 'logs' link if page is a hidden user in 'Get edits'

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

Change #1016785 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_40] SECURITY: Hide 'logs' link if page is a hidden user in 'Get edits'

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

Change #1017127 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_39] SECURITY: Hide 'logs' link if page is a hidden user in 'Get edits'

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

SecurityPatchBot raised the priority of this task from Low to Unbreak Now!.Apr 9 2024, 12:00 AM

Patch 02-T361479.patch is currently failing to apply for the most recent code in the mainline branch of extensions/CheckUser. This is blocking MediaWiki release 1.42.0-wmf.26(T360158)

If the patch needs to be rebased

To unblock the release, a new version of the patch can be placed at the right location in the deployment server with the following Scap command:

REVISED_PATCH=<path_to_revised_patch>
scap update-patch --message-body 'Rebase to solve merge conflicts with mainline code' /srv/patches/1.42.0-wmf.26/extensions/CheckUser/02-T361479.patch "$REVISED_PATCH"

If the patch has been made public

To unblock the release, the patch can be removed for the right version from the deployment server with the following Scap command:

scap remove-patch --message-body 'Remove patch already made public' /srv/patches/1.42.0-wmf.26/extensions/CheckUser/02-T361479.patch

(Note that if patches for the version don't exist yet, they will be created and the patch you specified removed)

I have removed the patch from the deployment server since it got merged and made its way to the MediaWiki deployment train this week.

Dreamy_Jazz lowered the priority of this task from Unbreak Now! to Low.Apr 9 2024, 12:00 PM

Change #1017122 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@REL1_41] Follow-up fix to 'Get edits' security fix

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

I can no longer see a logs link with the suppressed user's name.

Test environment: local docker CheckUser 2.5 (5f204f2) 07:27, 15 April 2024.

mmartorana renamed this task from Special:CheckUser 'Get actions' page link can expose the username of a suppressed user via the 'logs' URL to CVE-2024-40607: Special:CheckUser 'Get actions' page link can expose the username of a suppressed user via the 'logs' URL.Jul 8 2024, 5:33 PM
mmartorana changed the visibility from "Custom Policy" to "Public (No Login Required)".Jul 10 2024, 8:52 AM