[go: up one dir, main page]

Page MenuHomePhabricator

CVE-2024-34505: Temporary account IP reveal does not check the deleted status of the performer before revealing the IP address associated with an edit/log event
Closed, ResolvedPublic2 Estimated Story PointsSecurity

Description

The CheckUser extension provides the ability for users with the checkuser-temporary-account right to view the IP address associated with temporary accounts. This REST API does not check the deleted status of the performer on log actions and edits that are looked up.

The risk with this is somewhat limited because you must already know the temporary account username. However, these are auto-generated in a serial manner which means that guessing the username is not difficult if you make multiple requests or look at Special:ListUsers for missing usernames.

The risk with this is that users who log out of their account by accident and then make an edit have the IP address that made the edit suppressed on WMF wikis. However, if the wiki uses temporary accounts then suppressing the performer of the edit and/or blocking the temporary account with hideuser enabled does not prevent a user from using the REST API to find the IP address used to make the edit. This would allow an attacker to get the IP address associated with a registered user who forgot to log in to make their edit, even if the users with the ability to suppress information had attempted to hide the data.

Note: This security issue is currently not exploitable on production as temporary accounts are not enabled there and this REST API can only be used if temporary accounts are enabled. This does affect any third-party wiki that uses CheckUser with temporary account autocreation enabled.

Steps to reproduce
  1. Make an edit on a wiki with temporary account creation enabled
  2. Log into an account with the ability to suppress information
  3. Suppress the temporary account username on the edit made in step 1
  4. Log out and into an account with just the checkuser-temporary-account right
  5. Go to Special:Preferences and make sure to check the checkuser-temporary-account-enable preference
  6. Make a GET request to the REST API with the URL /checkuser/v0/temporaryaccount/{name}/revisions/{ids} where {name} is replaced with the temporary account username used to make the edit in step 1 and the {ids} is replaced with the revision ID of the edit made in step 1

What happens
The IP address associated with the edit made in step 1 is returned

What should have happened
The IP address was not returned as the performer of the edit was suppressed

QA Results - Local

Event Timeline

@sbassett can I just upload the fix publicly and then backport it? I think this is okay because:

  1. This does not affect production (because temporary accounts are not enabled), and as such does not need to be deployed there
  2. CheckUser is not a bundled extension, and as such my understanding is that security patches can be backported at any time after production is fixed (which doesn't apply because of point 1)

I ask this because I want to run the patch I have through CI, which I can't do unless it is on gerrit.

I have the following which I think is ready for review. The tests pass on my local environment, but I do not know whether they will pass in CI.

Dreamy_Jazz set the point value for this task to 2.Jan 24 2024, 6:51 PM

@sbassett can I just upload the fix publicly and then backport it? I think this is okay because:

  1. This does not affect production (because temporary accounts are not enabled), and as such does not need to be deployed there
  2. CheckUser is not a bundled extension, and as such my understanding is that security patches can be backported at any time after production is fixed (which doesn't apply because of point 1)

I'd agree that having this go through gerrit is low-risk given the above justifications. We can open up this task as well, if you'd like, though I did add @gerritbot as a subscriber. I'd also like to track this at T353904.

@sbassett can I just upload the fix publicly and then backport it? I think this is okay because:

  1. This does not affect production (because temporary accounts are not enabled), and as such does not need to be deployed there
  2. CheckUser is not a bundled extension, and as such my understanding is that security patches can be backported at any time after production is fixed (which doesn't apply because of point 1)

I'd agree that having this go through gerrit is low-risk given the above justifications. We can open up this task as well, if you'd like, though I did add @gerritbot as a subscriber. I'd also like to track this at T353904.

Thanks. I will upload to this gerrit now.

We can probably leave this protected until the backports are done, but happy either way.

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

[mediawiki/extensions/CheckUser@master] [SECURITY] Check for deleted status in temp account REST APIs

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

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

[mediawiki/extensions/CheckUser@REL1_41] [SECURITY] Check for deleted status in temp account REST APIs

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

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

[mediawiki/extensions/CheckUser@REL1_40] [SECURITY] Check for deleted status in temp account REST APIs

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

Change 992770 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@REL1_40] [SECURITY] Check for deleted status in temp account REST APIs

Reason:

Discussed in TSP meeting and decided that we shouldn't need backports.

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

Change 992769 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@REL1_41] [SECURITY] Check for deleted status in temp account REST APIs

Reason:

Discussed in a TSP meeting and decided this shouldn't need backports.

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

Change 992795 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] [SECURITY] Check for deleted status in temp account REST APIs

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

sbassett triaged this task as Medium priority.Feb 5 2024, 4:27 PM
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 Medium.

Suggested QA steps:

  1. Enable temporary account autocreation
  2. Make at least two edits and two log actions on one temporary account username. Then make one or more edits on another temporary account username.
  3. Log into an account with the checkuser and suppress groups
  4. Block the second temporary account from step 2 with hideuser
  5. Suppress the performer of one edit and one log action from the temporary user created first in step 2. Note down the revision ID and log ID you suppressed for future steps.
  6. Make a request to /checkuser/v0/temporaryaccount/{name} where {name} is replaced with the temporary account you suppressed in step 4
  7. Verify that you see IP addresses in the result
  8. Log out and then log into an account with just the checkuser group
  9. Repeat step 6 and verify that you instead receive a 404 error
  10. Get the revision ID of the suppressed edit from step 5and one other revision ID for an edit performed by that temporary account. Use these to make a request to /checkuser/v0/temporaryaccount/{name}/revisions/{ids} where {ids} is generated by combining the revision IDs using the | character and {name} is the temporary account username. For example, /checkuser/v0/temporaryaccount/*Unregistered 10/revisions/101|102
  11. Verify that the response to the request in step 10 has one entry in the ips array for the revision ID that did not have the performer suppressed, but the revision ID that was suppressed is not present.
  12. Get the log ID of the suppressed log from step 5 and one other log ID performed by that temporary account. Use these to make a request to /checkuser/v0/temporaryaccount/{name}/logs/{ids} where {ids} is generated by combining the log IDs using the | character and {name} is the temporary account username. For example, /checkuser/v0/temporaryaccount/*Unregistered 10/logs/101|102
  13. Verify that the response to the request in step 12 has one entry in the ips array for the log ID that did not have the performer suppressed, but the log ID that was suppressed is not present.

@Dreamy_Jazz Everything was good until the last couple of steps for me with the logs. Can you please review the .webm I have below to see if I'm missing something from steps 12-13?

Status: ❌ FAIL (Steps 12-13)
Environment: Local: 1.42.0-alpha (289a900)17:59, 13 February 2024; Checkuser: 2.5 (4642899) 11:11, 13 February 2024
OS: macOS Sonoma 14.2.1
Browser: Chrome 121
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/w/index.php?title=Lion&action=history
http://localhost:8080/w/index.php?title=Samurai&action=history

Steps 1-3

Temp Acct (2 edits/2log)Temp Acct just editsUser w/checkuser &suppress
2024-02-13_10-38-10.png (581×3 px, 237 KB)
2024-02-13_10-38-23.png (667×3 px, 262 KB)
2024-02-13_10-37-23.png (1×2 px, 258 KB)

Steps 4-7

Steps 8-9

Steps 10-11

Steps 12-13 Log ID 17 is suppressed Special:Log ❌
http://localhost:8080/w/rest.php/checkuser/v0/temporaryaccount/~2024-13/logs/16|17

@Dreamy_Jazz

I tried another log type with "move" and I'm seeing both IP addresses even though the other one is suppressed as seen in the .webm below with a user with only checkuser only rights.

@Dreamy_Jazz Previous steps have been passed as seen in https://phabricator.wikimedia.org/T355434#9539736. After suppressing in Special:Log for step 12, I was able to get the result as expected as seen in the screenshots below. The original issue that was noticed of that the CheckUser extension does not store the IP address associated with the log event for page creation, T357523: Temporary account IP reveal fails for log entries that are for the creation of a page has been created. This task will be moved to Done. Thanks for all your work and steps!

Status: ✅PASS (Steps 12-13)
Environment: Local: 1.42.0-alpha (289a900)17:59, 13 February 2024; Checkuser: 2.5 (4642899) 11:11, 13 February 2024
OS: macOS Sonoma 14.2.1
Browser: Chrome 121
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/w/index.php?title=King_of_Beasts&action=history
Special:Log

Log SurpressedResult
2024-02-14_10-26-05.png (966×3 px, 267 KB)
2024-02-14_10-20-33.png (109×1 px, 19 KB)
Mstyles renamed this task from Temporary account IP reveal does not check the deleted status of the performer before revealing the IP address associated with an edit/log event to CVE-2024-34505: Temporary account IP reveal does not check the deleted status of the performer before revealing the IP address associated with an edit/log event.May 6 2024, 9:09 AM