Page MenuHomePhabricator

Special:Recover2FAForUser should generate short-lived recovery codes
Closed, ResolvedPublic

Description

Currently, the recovery codes in OATHAuth have infinite lifespan. This is fine for the typical use of recovery codes (store safely and use in emergency). However, codes generated with Special:Recover2FAForUser are potentially known to a few intermediary parties (all those who can access the target user's email inbox, now and in future).

This makes it possible for a future attacker, who gets access to the target user email, to grab recovery codes and try them to log into Wikimedia wikis, hoping they weren't invalidated. In order to mitigate this, codes generated by this special page should be short-lived.

Acceptance criteria

  • Recovery codes generated by Special:Recover2FAForUser can be used only for 7 days after they have been generated.

Event Timeline

Change #1259929 had a related patch set uploaded (by Mszwarc; author: Mszwarc):

[mediawiki/extensions/OATHAuth@master] Recover2FAForUser: Generate expiring codes

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

Change #1259929 merged by jenkins-bot:

[mediawiki/extensions/OATHAuth@master] Recover2FAForUser: Generate expiring codes

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