Page MenuHomePhabricator

PHP Fatal Error: Argument 2 passed to AbuseFilter::executeFilterActions() must be an instance of Title, null given
Closed, ResolvedPublic

Description

Error

Request ID: XJU3CwpAIC8AABoWRMYAAACS

message
PHP Fatal Error: Argument 2 passed to AbuseFilter::executeFilterActions() must be an instance of Title, null given
trace
#0 /srv/mediawiki/php-1.33.0-wmf.22/extensions/AbuseFilter/includes/AbuseFilter.php(1215): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.33.0-wmf.22/extensions/AbuseFilter/includes/AbuseFilterHooks.php(837): AbuseFilter::filterAction(AbuseFilterVariableHolder, NULL, string, User)
#2 /srv/mediawiki/php-1.33.0-wmf.22/extensions/AbuseFilter/includes/AbuseFilterHooks.php(752): AbuseFilterHooks::filterUpload(string, UploadFromFile, User, array, NULL, NULL, NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.22/includes/Hooks.php(174): AbuseFilterHooks::onUploadStashFile(UploadFromFile, User, array, NULL)
#4 /srv/mediawiki/php-1.33.0-wmf.22/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#5 /srv/mediawiki/php-1.33.0-wmf.22/includes/upload/UploadBase.php(1080): Hooks::run(string, array)
#6 /srv/mediawiki/php-1.33.0-wmf.22/includes/upload/UploadBase.php(1060): UploadBase->runUploadStashFileHook(User)
#7 /srv/mediawiki/php-1.33.0-wmf.22/includes/specials/SpecialUpload.php(350): UploadBase->tryStashFile(User)
#8 /srv/mediawiki/php-1.33.0-wmf.22/includes/specials/SpecialUpload.php(707): SpecialUpload->showRecoverableUploadError(string)
#9 /srv/mediawiki/php-1.33.0-wmf.22/includes/specials/SpecialUpload.php(511): SpecialUpload->processVerificationError(array)
#10 /srv/mediawiki/php-1.33.0-wmf.22/includes/specials/SpecialUpload.php(207): SpecialUpload->processUpload()
#11 /srv/mediawiki/php-1.33.0-wmf.22/includes/specialpage/SpecialPage.php(569): SpecialUpload->execute(NULL)
#12 /srv/mediawiki/php-1.33.0-wmf.22/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#13 /srv/mediawiki/php-1.33.0-wmf.22/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#14 /srv/mediawiki/php-1.33.0-wmf.22/includes/MediaWiki.php(867): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.33.0-wmf.22/includes/MediaWiki.php(517): MediaWiki->main()
#16 /srv/mediawiki/php-1.33.0-wmf.22/index.php(42): MediaWiki->run()
#17 /srv/mediawiki/w/index.php(3): include(string)
#18 {main}

Impact

Users cannot upload the image if certain conditions are met (=if a filter of unknown ID matches the action)

Notes

This is well known, and has the same cause as T144265. Basically, if the user inserts an invalid title for an image, we run filters with 'stashupload' action without populating page-related variables. If any filter still matches the action (basically only using user-related and file-related vars) and we try to take any consequence, the exception above is thrown.
Per T144265#4908543 and T144265#4938272, the chosen solution is to not run filters at all if we don't have a title [0], and is already on gerrit as https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/AbuseFilter/+/464119/.

[0]: Note that if the title is invalid, the upload form will ask the user to provide one, and when they do we'll run filters again - with 'upload' action instead of 'stashupload'.

Event Timeline

Daimona triaged this task as High priority.Mar 22 2019, 7:58 PM
Daimona created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 22 2019, 7:58 PM

Change 464119 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/extensions/AbuseFilter@master] Don't run filters with null title

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

Change 464119 merged by Krinkle:
[mediawiki/extensions/AbuseFilter@master] Don't run filters with null title

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

Daimona closed this task as Resolved.May 26 2019, 3:25 PM
Daimona removed a project: Patch-For-Review.