Page MenuHomePhabricator

CannotCreateActorException when creating a temporary account on an edit which causes an abuse filter log
Closed, ResolvedPublic1 Estimated Story PointsBUG REPORT

Description

it seems that AbuseFilter sends private event entries to CheckUser when a match occurs before the temporary account is created for an edit. This causes an exception because CheckUser needs the temporary account to exist and also to have an actor ID. Found when testing my patch for T357615.

Steps to replicate the issue
  1. Install AbuseFilter and CheckUser
  2. Create a filter that targets all edits (for example the conditions are action = 'edit') but the filter just is set to log
  3. Enable temporary accounts on a wiki
  4. While logged out, try to make an edit to a page that is not protected

What happens?:
The edit fails, no temporary account is created for the user, and an exception is shown:

image.png (724×1 px, 160 KB)

What should have happened instead?:
The edit should have succeeded as the filter did not block the edit

Software version

CheckUser 2.5 (bc635d6) 07:19, 27 February 2024. Abuse Filter – (e530aed) 23:50, 27 February 2024

QA Results - Local

Event Timeline

Dreamy_Jazz renamed this task from CannotCreateActorException: Cannot create an actor for a usable name that is not an existing user: user_name="~34" to CannotCreateActorException: Cannot create an actor for a usable name that is not an existing user when creating a temporary account on an edit.Feb 28 2024, 12:04 AM

This is fixable on my local wiki by wrapping the call to Hooks::updateCheckUserData in AbuseLogger::insertLocalLogEntries in a DeferredUpdate.

Dreamy_Jazz renamed this task from CannotCreateActorException: Cannot create an actor for a usable name that is not an existing user when creating a temporary account on an edit to CannotCreateActorException when creating a temporary account on an edit which causes an abuse filter log.Feb 28 2024, 12:10 AM
Dreamy_Jazz claimed this task.
Dreamy_Jazz set the point value for this task to 1.

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

[mediawiki/extensions/AbuseFilter@master] Send AbuseFilter logs to CheckUser on PRESEND

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

Change 1007021 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Send AbuseFilter logs to CheckUser on PRESEND

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

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

[mediawiki/extensions/AbuseFilter@master] Add integration test to verify logs are saved in CheckUser

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

Status: ✅PASS
Environment: Beta: 1.42.0-alpha (277e4ea) 15:17, 28 February 2024; Checkuser- 2.5 (17fd03e) 18:28, 16 February 2024; AbuseFilter- (901d881) 13:37, 28 February 2024
OS: macOS Sonoma 14.2.1
Browser: Chrome 122, Firefox 123, Safari 17.3, Edge 122
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
Special:AbuseFilter
https://en.m.wikipedia.beta.wmflabs.org/wiki/Cat

✅AC1: https://phabricator.wikimedia.org/T358632

ChromeFirefoxSafariEdge
2024-02-29_13-07-13.png (548×2 px, 314 KB)
2024-02-29_13-08-01.png (597×2 px, 262 KB)
2024-02-29_13-08-58.png (591×1 px, 265 KB)

Change 1007657 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Add integration test to verify logs are saved in CheckUser

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

For reasons not immediately clear to me, Wikibase editing does not trigger the CannotCreateActor exception. T371085: AbuseFilter for Wikidata actions leaks IP address is exploring a patch related to creating the temp account earlier in the cycle (cc @Lucas_Werkmeister_WMDE).