Page MenuHomePhabricator

NamespaceInfo::getAssociated does not make any sense for given namespace
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.9

message
NamespaceInfo::getAssociated does not make any sense for given namespace -9845

Impact

Unclear.

Notes

Just saw a batch of these show up in logs. Not persistent and not due to new MW software.

Details

Request ID
2f9564cb-2a27-4b3f-8428-b43c3cd2334e
Request URL
https://cs.wikipedia.org/wiki/Speci%C3%A1ln%C3%AD:Nov%C3%A9_str%C3%A1nky?namespace=-9845%20OR%202408%3D%28SELECT%20UPPER%28XMLType%28CHR%2860%29%7C%7CCHR%2858%29%7C%7CCHR%28113%29%7C%7CCHR%28106%29%7C%7CCHR%28120%29%7C%7CCHR%28122%29%7C%7CCHR%28113%29%7C%7C%28SELECT%20%28CASE%20WHEN%20%282408%3D2408%29%20THEN%201%20ELSE%200%20END%29%20FROM%20DUAL%29%7C%7CCHR%28113%29%7C%7CCHR%28106%29%7C%7CCHR%28112%29%7C%7CCHR%28107%29%7C%7CCHR%28113%29%7C%7CCHR%2862%29%29%29%20FROM%20DUAL%29--%20RFtw&invert=1&associated=1&tagfilter=SnzL&username=&size-mode=min&size=NqnN&wpFormIdentifier=newpagesform
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.9/includes/title/NamespaceInfo.php(301): NamespaceInfo->isMethodValidFor(integer, string)
#1 /srv/mediawiki/php-1.36.0-wmf.9/includes/specials/pagers/NewPagesPager.php(160): NamespaceInfo->getAssociated(integer)
#2 /srv/mediawiki/php-1.36.0-wmf.9/includes/specials/pagers/NewPagesPager.php(86): NewPagesPager->getNamespaceCond()
#3 /srv/mediawiki/php-1.36.0-wmf.9/includes/pager/IndexPager.php(466): NewPagesPager->getQueryInfo()
#4 /srv/mediawiki/php-1.36.0-wmf.9/includes/pager/IndexPager.php(447): IndexPager->buildQueryInfo(string, integer, boolean)
#5 /srv/mediawiki/php-1.36.0-wmf.9/includes/pager/IndexPager.php(280): IndexPager->reallyDoQuery(string, integer, boolean)
#6 /srv/mediawiki/php-1.36.0-wmf.9/includes/pager/IndexPager.php(733): IndexPager->doQuery()
#7 /srv/mediawiki/php-1.36.0-wmf.9/includes/specials/SpecialNewpages.php(170): IndexPager->getNumRows()
#8 /srv/mediawiki/php-1.36.0-wmf.9/includes/specialpage/SpecialPage.php(600): SpecialNewpages->execute(NULL)
#9 /srv/mediawiki/php-1.36.0-wmf.9/includes/specialpage/SpecialPageFactory.php(680): SpecialPage->run(NULL)
#10 /srv/mediawiki/php-1.36.0-wmf.9/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /srv/mediawiki/php-1.36.0-wmf.9/includes/MediaWiki.php(940): MediaWiki->performRequest()
#12 /srv/mediawiki/php-1.36.0-wmf.9/includes/MediaWiki.php(543): MediaWiki->main()
#13 /srv/mediawiki/php-1.36.0-wmf.9/index.php(53): MediaWiki->run()
#14 /srv/mediawiki/php-1.36.0-wmf.9/index.php(46): wfIndexMain()
#15 /srv/mediawiki/w/index.php(3): require(string)
#16 {main}

Event Timeline

@dancy its because someone was manually messing with their url I think. Percent decoding returns:

https://cs.wikipedia.org/wiki/Speciální:Nové_stránky?namespace=-9845 OR 2408=(SELECT UPPER(XMLType(CHR(60)||CHR(58)||CHR(113)||CHR(106)||CHR(120)||CHR(122)||CHR(113)||(SELECT (CASE WHEN (2408=2408) THEN 1 ELSE 0 END) FROM DUAL)||CHR(113)||CHR(106)||CHR(112)||CHR(107)||CHR(113)||CHR(62))) FROM DUAL)-- RFtw&invert=1&associated=1&tagfilter=SnzL&username=&size-mode=min&size=NqnN&wpFormIdentifier=newpagesform

which is unlikely to occur to a normal end user. Still should be fixed though.

Ammarpad raised the priority of this task from Low to High.Sep 23 2020, 5:49 PM
Ammarpad added a subscriber: Ammarpad.

This exception can be triggered deterministically at will by passing negative namespace number. The request parameters obviously need more sanity checks

Change 629393 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] NewPagesPager: Ignore nonexistent namespaces

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

Change 629393 merged by jenkins-bot:
[mediawiki/core@master] NewPagesPager: Ignore nonexistent namespaces

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

Change 629516 had a related patch set uploaded (by Reedy; owner: DannyS712):
[mediawiki/core@REL1_35] NewPagesPager: Ignore nonexistent namespaces

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

Change 629516 merged by jenkins-bot:
[mediawiki/core@REL1_35] NewPagesPager: Ignore nonexistent namespaces

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