Page MenuHomePhabricator

NetworkSession and AbuseFilter may be spammy
Closed, ResolvedPublic3 Estimated Story Points

Description

Reported at https://www.mediawiki.org/wiki/Topic:Ybk8j4rz9c0v7ta4

It is unclear what the resolution should be but it appears that a particular set of AbuseFilter rules (autocreateaccount) and the use of an NetworkSession auth scheme will cause AbuseFilter to believe that an account was created automatically.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Gehel set the point value for this task to 3.Sep 2 2024, 3:22 PM

I tried creating the account with the createAndPromote.php script, but it gets rejected in the same way that the normal account creation gets rejected. I'm not sure how else to go about creating the account?

Did Special:CreateLocalAccount work?

Did Special:CreateLocalAccount work?

Nope, I'm not an admin or a steward. Any of my "elevated" access is primarily through shell access. I could plausibly temporarily grant myself admin, but not sure that's appropriate.

This is moot now, given NetworkSession being disabled in T373826, but the correct maintenance script to run appears to be createLocalAccount.php from the CentralAuth extension, not createAndPromote.php from core.

How does AbuseFilter prevent autocreation? Permission checks should be skipped since NetworkSession returns true for canAlwaysAutocreate().

Hm, I guess we can't just skip testUserForCreation, it's used for non-permission-related things like preventing CentralAuth username conflicts. So the way to go is probably to pass in the "can always autocreate" flag and let the provider decide what's appropriate.

@EBernhardson do you want to make a patch for that?

Change #1071013 had a related patch set uploaded (by Ebernhardson; author: Ebernhardson):

[mediawiki/core@master] auth: Pass canAlwaysAutocreate from session to pre-auth providers

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

Change #1071014 had a related patch set uploaded (by Ebernhardson; author: Ebernhardson):

[mediawiki/extensions/AbuseFilter@master] Skip auth checks when autocreate is allowed by provider

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

Change #1071014 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Skip auth checks when autocreate is allowed by provider

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

Change #1071013 merged by jenkins-bot:

[mediawiki/core@master] auth: Pass canAlwaysAutocreate from session to pre-auth providers

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

Gehel triaged this task as High priority.Sep 9 2024, 2:05 PM