Page MenuHomePhabricator

CVE-2025-23073: API list=globalblocks can reveal IP of autoblock if username and IP are included in the bgtargets parameter
Closed, ResolvedPublicSecurity

Description

What is the problem?

If I global block a username with an autoblock against their IP, if I make an API request to action=query&list=globalblocks and set the bgtargets=<username>|<user's ip>, the response will include both the global block against the user and their respective autoblock.

You do have to guess the user's IP correctly.

I don't believe the global autoblock feature is switched on in any production environment.

Steps to reproduce problem
  1. On a wiki with both GlobalBlocking and CheckUser installed
  2. Find out what your IP is on a wiki (e.g. while logged out go to Special:MyTalk)
  3. Login as a regular user and make an edit (so your IP is recorded by CheckUser)
  4. Login as an admin who can create global blocks
  5. Go to Special:GlobalBlock
  6. Enter the user from step 3 as target and make sure Automatically globally block the last IP address used by this user, and any subsequent IP addresses they try to edit from, for a period of 1 day is checked (it is by default). Submit the block.
  7. Go to Special:ApiSandbox#action=query&list=globalblocks&bgtargets=<username>|<user ip> (replace <username> and <user ip> with the IP from step 1 and the user from step 3). Submit.

Expected behaviour: The API only returns one block for the username.
Observed behaviour: The API returns two blocks.

Environment

Wiki(s): local docker GlobalBlocking – (6d5fb35) 16:55, 21 October 2024.

Event Timeline

I think, given that this is not an issue that can be produced on production and is not a problem in any release version, I will upload the patch publicly.

I think, given that this is not an issue that can be produced on production and is not a problem in any release version, I will upload the patch publicly.

Sounds fine to me.

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

[mediawiki/extensions/GlobalBlocking@master] globalblocks API: Hide autoblocks when target param has username and IP

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

Dreamy_Jazz changed Due Date from Oct 27 2024, 11:00 PM to Oct 28 2024, 11:00 PM.Oct 28 2024, 12:44 PM

Change #1082231 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] globalblocks API: Hide autoblocks when target param has username and IP

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

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

[mediawiki/extensions/GlobalBlocking@wmf/1.43.0-wmf.28] globalblocks API: Hide autoblocks when target param has username and IP

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

Change #1084748 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@wmf/1.43.0-wmf.28] globalblocks API: Hide autoblocks when target param has username and IP

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

I can no longer reproduce this bug.

I have tried querying with various combinations of parameters and checking that autoblocks do not appear when we include an IP either in the bgtargets or bgip parameters.

This can be made public now too.

sbassett triaged this task as Medium priority.Oct 31 2024, 4:38 PM
sbassett changed Author Affiliation from N/A to WMF Product.
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.
sbassett removed a project: Patch-For-Review.
sbassett moved this task from Watching to Our Part Is Done on the Security-Team board.
mmartorana renamed this task from API list=globalblocks can reveal IP of autoblock if username and IP are included in the bgtargets parameter to CVE-2025-23073: API list=globalblocks can reveal IP of autoblock if username and IP are included in the bgtargets parameter.Tue, Jan 14, 7:18 PM

@mmartorana, the CVE description appears to be wrong. This security issue was never present in any release version of MediaWiki, but it says it was a problem in all currently supported release versions. Can this be fixed?

@mmartorana, the CVE description appears to be wrong. This security issue was never present in any release version of MediaWiki, but it says it was a problem in all currently supported release versions. Can this be fixed?

We should be able to amend that information, yes.

@mmartorana, the CVE description appears to be wrong. This security issue was never present in any release version of MediaWiki, but it says it was a problem in all currently supported release versions. Can this be fixed?

Hi @Dreamy_Jazz - Thanks for noticing this, It should be fixed now: https://www.cve.org/cverecord?id=CVE-2025-23073

@mmartorana, the CVE description appears to be wrong. This security issue was never present in any release version of MediaWiki, but it says it was a problem in all currently supported release versions. Can this be fixed?

Hi @Dreamy_Jazz - Thanks for noticing this, It should be fixed now: https://www.cve.org/cverecord?id=CVE-2025-23073

Thanks for the quick fix.