Page MenuHomePhabricator

TemporaryAccountHandler API shouldn't return more results than $wgCheckUserMaximumRowCount
Closed, ResolvedPublic

Description

From T324602#8712185 TemporaryAccountHandler can return more results than $wgCheckUserMaximumRowCount.

T324602_IPMasking_SpecialBlock_CheckMax.png (598ร—3 px, 396 KB)

What's happening?

See TemporaryAccountHandler.php:

The problem is that the query is only limited if a 'limit' parameter is supplied:

->limit( $this->getValidatedParams()['limit'] )

The 'limit' param can't be higher than $wgCheckUserMaximumRowCount:

IntegerDef::PARAM_MAX => $this->config->get( 'CheckUserMaximumRowCount' )

but if no limit is supplied, then more results than the limit may be fetched.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptMar 30 2023, 4:25 PM

Change 908007 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/CheckUser@master] Check for and enforce $wgCheckUserMaximumRowCount

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

Change 908007 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Check for and enforce $wgCheckUserMaximumRowCount

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

@STran I'm not sure if I'm missing anything but it's ignoring the $wgCheckUserMaximumRowCount number count in Special:Block as seen in the screenshot.

UPDATE: I forgot to disable my cache, which is now working. I will continue with my testing and let you know if anything else comes up. Thanks!

T333583_IPMasking_MaxRowCount.png (397ร—2 px, 292 KB)

@STran Looks like everything is good to go now. Before I move this to Done, on the last screenshot, is that the correct wording for the error message?

OS: macOS 13.3
Browsers: Chrome 112, Firefox 112, Safari 16.3
Skins: Vector 2022, 2010, Minerva, Timeless, Monobook

*Unregistered 18 temp user - 8 IP addresses

T325768_IPMasking_CheckUserMaximumRowCount1.png (675ร—1 px, 276 KB)

Special:Block- Local Config $wgCheckUserMaximumRowCount = 3;

T325768_IPMasking_CheckUserMaximumRowCount_SpecialBlock.png (405ร—2 px, 248 KB)

http://localhost:8080/w/rest.php/checkuser/v0/temporaryaccount/*Unregistered%2018 - Local Config $wgCheckUserMaximumRowCount = 3;

T325768_IPMasking_CheckUserMaximumRowCount_URL.png (364ร—1 px, 185 KB)

http://localhost:8080/w/rest.php/checkuser/v0/temporaryaccount/*Unregistered%2018?limit=1 -?lmit<#> in URL

T325768_IPMasking_CheckUserMaximumRowCount_URL2.png (104ร—745 px, 24 KB)

URL limit=4 higher than $wgCheckUserMaximumRowCount = 3; error message

T325768_IPMasking_CheckUserMaximumRowCount_URLError.png (417ร—3 px, 217 KB)

Yes that should be fine. This patch didn't change that error message. Thanks!

Ok sounds good, I'll move it to Done. Thanks!