Page MenuHomePhabricator

Handle scrambled password type in CentralAuth
Closed, ResolvedPublic

Description

When a low-value account is taken over but the email is not changed, we want to be able to lock the account but allow the owner to recover. Proper account locking means the owner will need to request unlocking; an extra inconvenience for everyone. So instead we just invalidate the password and the owner can recover it via password reset.

We can notify the owner via email, but maybe their email address is wrong. In which case they won't be able to recover their account, tough luck. But they should at least understand why they can't login, instead of just getting confusing "wrong password" errors.

So we want to:

  • Create a new invalid password type, ScrambledPassword / scrambled (must be exactly this string, as we went ahead and used it in {T395073}
  • When the password check fails and this password type is used, show a different error message that tells the user that their account has been compromised ("probably compromised"? not sure about the exact wording), their password has been invalidated, and they should do a password reset.
  • Create a maintenance script that takes a username list, scrambles their password (just need to prefix it with :scrambled:<reason>), and invalidates their session. Maybe also sends emails.
  • Prevent setting an identical password during password reset.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr updated the task description. (Show Details)

Change #1152818 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] Add support for password scrambling / unscrambling

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

Change #1152818 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Add support for password scrambling / unscrambling

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

You can scramble a password with

mwscript CentralAuth:ScramblePassword --user=<username> --task='<phabricator task>'

(or --users=<path to file with one username per line>) and unscramble with

mwscript CentralAuth:ScramblePassword --undo --user=<username> --task='<phabricator task>'

You can add --email-subject=<subject> --email-body=<path to file with email text> and optionally --email-sender=<username> to also send an email after every successful scramble / unscramble.

Change #1159568 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[operations/mediawiki-config@master] Revert "Add scrambled: password class"

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

Change #1161032 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@master] Fix password handling for non-existent users

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

Change #1161032 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Fix password handling for non-existent users

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

Change #1161950 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/CentralAuth@wmf/1.45.0-wmf.6] Fix password handling for non-existent users

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

Change #1161950 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@wmf/1.45.0-wmf.6] Fix password handling for non-existent users

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

Mentioned in SAL (#wikimedia-operations) [2025-06-23T20:14:27Z] <kharlan@deploy1003> Started scap sync-world: Backport for [[gerrit:1162998|Map pre-save RR scores to predefined values (T364705)]], [[gerrit:1161950|Fix password handling for non-existent users (T395372 T397262)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-23T20:38:46Z] <kharlan@deploy1003> kharlan, tgr: Backport for [[gerrit:1162998|Map pre-save RR scores to predefined values (T364705)]], [[gerrit:1161950|Fix password handling for non-existent users (T395372 T397262)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-23T20:58:57Z] <kharlan@deploy1003> Finished scap sync-world: Backport for [[gerrit:1162998|Map pre-save RR scores to predefined values (T364705)]], [[gerrit:1161950|Fix password handling for non-existent users (T395372 T397262)]] (duration: 44m 29s)

Change #1159568 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert "Add scrambled: password class"

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

Mentioned in SAL (#wikimedia-operations) [2025-06-30T20:09:30Z] <cjming@deploy1003> Started scap sync-world: Backport for [[gerrit:1159568|Revert "Add scrambled: password class" (T395360 T395372)]], [[gerrit:1165060|Enable experiment configs fetching for group 0 (T397144)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-30T20:11:27Z] <cjming@deploy1003> cjming, tgr: Backport for [[gerrit:1159568|Revert "Add scrambled: password class" (T395360 T395372)]], [[gerrit:1165060|Enable experiment configs fetching for group 0 (T397144)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-30T20:19:27Z] <cjming@deploy1003> Finished scap sync-world: Backport for [[gerrit:1159568|Revert "Add scrambled: password class" (T395360 T395372)]], [[gerrit:1165060|Enable experiment configs fetching for group 0 (T397144)]] (duration: 09m 57s)

Change #1203867 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/CentralAuth@master] Remove unused main config access

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

Change #1203867 merged by jenkins-bot:

[mediawiki/extensions/CentralAuth@master] Remove unused main config access

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