Designing account recovery
Account recovery is a way into an account that skips the usual methods, so it has to be designed as carefully as sign-in. This lesson follows one lost phone through the recovery methods NIST recognizes, the evidence each account needs, and the notices and delay that give the real owner a chance to object.
Recovery is a way to sign in
On a Friday evening Mia Lane's bag is stolen from a train, with her phone inside. The phone held the authenticator appSomething a person controls and uses to prove control of an account, such as a memorized password, an app that generates one-time codes, or a security key. It counts only after it has been registered to that account. that gives her Lab Photos codes, and the password manager that remembered her Lab Photos password, which she never learned by heart. On Monday she wants to order prints from the weekend's photos. Lab Photos asks for her password and then a code from the app, and Mia now has neither. Whatever Lab Photos lets her do next is, in effect, a way to sign in as Mia without the methods it normally insists on.
That is the uncomfortable truth about account recovery: it is an authenticationChecking evidence that someone, or some application, controls an account, such as a password or a passkey. It establishes which account is being used, not what that account may do. path. Anyone who can complete it gets the account, whoever they are. Enrollment, replacement, and recovery followed one person through losing and replacing an authenticator. This lesson is about designing the whole set of ways in at once, so that the account is no weaker than its weakest one.
Lab Photos asks for a second step so that a stolen password is not enough. If recovery accepted an emailed link alone, anyone who controls Mia's mailbox could skip that second step entirely. The account's real strength is the strength of the weakest path that ends with someone holding it, and recovery is usually that path.
One case is not recovery at all. Suppose Mia also had a passkeyA credential that your phone, computer or password manager creates for one website and keeps for you, unlocked with a fingerprint, face or PIN. Nothing you could type is sent, and it works only for the site it was made for, which helps it resist phishing. that she unlocks with her fingerprint, which is two factors on its own, and forgot only her password. She could sign in with the passkey and choose a new password: that is replacing one authenticator while she can still prove herself at the level the account requires. NIST SP 800-63B-4 draws the line there: recovery is what happens when someone can no longer authenticate at that level.
What NIST asks of recovery
NIST SP 800-63B-4 lists four recovery methods, and asks a service to support at least one of them, or a method of its own that a documented risk analysis supports:
| Method | What the person presents | Key requirements |
|---|---|---|
| Saved recovery codes | A code issued earlier and kept by the person | At least 64 bits of randomness; stored hashed; each works once and is replaced after use |
| Issued recovery codes | A code sent now to an address the person registered | At least six digits; valid 10 minutes by text or voice, 24 hours by email, 21 or 30 days by post |
| Recovery contacts | A code sent to someone the person trusts | The person can see and manage their contacts |
| Repeated identity proofing | The evidence from the original proofing, checked again | Only for accounts that were proofed, at the original level |
Then it sets how much evidence recovery needs, depending on the level the account is held to, using the authenticator assurance levels from Authenticator assurance levels. For an account that only ever needed AAL1, one code of any kind is enough. For AAL2, recovery needs one of three combinations: two recovery codes obtained through different methods, such as a saved code and a code emailed now; one recovery code together with an authenticator the person still holds, such as their password; or repeated identity proofingA process for establishing confidence that someone is the real person they claim to be, for example by checking identity documents and confirming that the evidence belongs to the person presenting it., if the account was proofed. An AAL3 account proofed in person at the highest identity assurance levelA published level of confidence for a process such as identity proofing, where each higher level requires stronger evidence and checks. Levels let a claim like "we verified this person" mean the same thing from one service to the next. is recovered by comparing a biometric, such as a face, with the one collected at that in-person proofing.
Mia's account asks for a password and an app code, so it is held to AAL2. No single piece of recovery evidence stands in for it: an emailed code alone is fine for a newsletter account and not for Mia's. And every recovery, whichever method it used, must produce a notification to the account holder.
Email turns up in that table, although Restricted authenticators explained that email never counts as a factor toward any level. The two rules fit together. A code sent to an inbox shows control of that inbox, which is too weak to count towards a sign-in. As one of two recovery codes it adds a second, independent channel, which is all recovery asks of it.
Saved recovery codes
When Mia first set up her authenticator app, Lab Photos showed her a set of recovery codes, each looking something like k7qmx-2rd9f: ten characters from an alphabet of 31 lowercase letters and digits that leaves out look-alikes such as l, 1, o and 0. Each character carries just under 5 bits of randomness, so one code carries about 49.5 bits. That falls short of the 64-bit minimum: a code from the same alphabet needs at least 13 characters to reach it, and sixteen characters from an alphabet of 32 carry 80 bits. Lab Photos stores only a keyed hashTurning data into a short, fixed-size value called a hash, in a way that cannot be reversed and where changing one character changes the result completely. Services store password hashes instead of passwords, and signatures are made over a hash. of each code, like a password, and limits wrong entries so that nobody can guess their way through. Using a code burns it, and Lab Photos shows how many remain.
Codes are the cheapest strong recovery evidence there is, and their weakness is entirely human. A code saved only on the phone that was stolen backs up nothing. Mia printed hers and keeps them at home, which is why Monday is recoverable at all. Services that issue codes should say plainly where not to keep them, and remind people to look again when they replace a device. Generating a new set must invalidate the old one and send a notification, because an attacker with a sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier. would like nothing better than a fresh set of their own.
Issued codes and recovery contacts
An issued code is generated at the moment of recovery and sent to an address the person registered earlier: a phone number, an email address, or a postal address. A link that carries such a code, like the password reset link Mia's mailbox receives, is the same evidence in another form. Its strength is the strength of that channel. A personal mailbox may have a weak password of its own, and a phone number can be moved to another SIM by a persuasive caller, which is why text and voice codes expire in ten minutes, and why NIST asks services to let people register at least two recovery addresses, so that losing one does not end recovery. A new address must itself be confirmed with a code before it counts.
A recovery contact is a person instead of a channel. Mia could name a friend; when she starts recovery, the code goes to the friend, who passes it to her once satisfied it is really Mia asking. It is a useful option for people without a second device, and it adds a human check. It also adds a target, so contacts should be reviewed from time to time, and an attacker who already holds Mia's session must not be able to add one quietly.
The help desk and identity proofing
Some people will have lost everything: device, codes and the mailbox or phone number that would receive an issued code. For them, recovery comes down to proving who they are again, and that is only possible when there was proofing to repeat. Lab Photos' staff, such as Ben Okafor on the help desk, were proofed when they were hired, so a staff member who loses everything can show the same kind of evidence again, in a video call checked against the photo on file or in person at the office, and the help desk acts only on the result. Mia's customer account was never proofed, so there is nothing to repeat for her. Lab Photos relies on codes and recovery contacts for customers, and says plainly at enrollment that losing every method and every code may mean losing the account.
The help desk is where recovery is most often attacked, by callers who sound convincing and know facts anyone could look up. For the design, the important decisions are structural. Help desk staff can start a recovery but should not be able to complete one on their own say-so. The checks they perform are defined in advance, matched to the account's level, and recorded. When the help desk calls someone back, it uses a number already on file, never one the caller supplies. And recovering an account that holds a management role needs stronger evidence and a second person's approval, because a mistake there hands over everyone's accounts.
Notification and a cool-off period
Every recovery sends a notice, and the important detail is where it goes. A notice sent only to a new address an attacker just registered tells the attacker. Lab Photos sends it to every channel the account had before the recovery started: Mia's registered email address and any devices still enrolled, and, for a staff account, the person's manager. The message says what changed, when, from where, and what to do if it was not her.
A notice only helps if there is time to act on it. That is the idea behind a cool-off period: a recovery that replaces every method at once is accepted at once but takes effect only after a delay, often a day or several, with notices at the start and again before it completes. If the real owner sees the notice, one click cancels the recovery and locks it. NIST does not require a delay, and it has a real cost, since Mia cannot use her account while she waits. So Lab Photos applies one only to self-service recovery that replaces every method, such as a saved code with an emailed code, and skips it when the help desk has completed proofing.
Whatever the path, recovery should end with the same tidy-up: the recovered account enrolls a new authenticator immediately, the lost one is removed, every existing session is ended, and any remaining recovery codes are replaced. Recovery that leaves the old sessions running has restored the owner's access without removing anyone else's.
Recovery and passkeys
Passkeys change recovery more than any other method. A synced passkey is backed up by its credential provider, so losing a phone often loses nothing: a new phone restores the passkeys when its owner signs in to the provider account, as When the passkey lives with a provider described. That moves part of the recovery problem to the provider's account, whose own recovery now sits in the chain. If Mia had used a synced passkey for Lab Photos, her provider's recovery would have decided much of Monday.
Device-bound security keys, which Lab Photos issues to staff who hold management roles, cannot be backed up at all. Their recovery plan is a second registered key, kept apart from the first, and proofing for the day both are lost. Keeping the backup key on the same keyring as the first is the kind of mistake a service should warn about at enrollment rather than after a theft.
The design trap is a strong method with a weak escape. If Lab Photos requires phishing-resistantA property of an authentication method that binds sign-in to the real service, so evidence entered on a look-alike site cannot be passed on and used. Passkeys have it; passwords and one-time codes do not. sign-in for its staff but lets anyone who forgets their key receive an emailed link, a phishingTricking someone, usually with a message and a look-alike sign-in page, into handing over the evidence that opens their account, such as a password or a one-time code. page simply asks for the link. Recovery for an account held to phishing-resistant sign-in should either end in a new phishing-resistant authenticator through evidence a phishing page cannot relay, such as in-person proofing or a check with a manager on a known number, or leave the account restricted until it does.
A recovery design
Lab Photos wrote its design as one table, so that every path into an account sits next to every other:
| Situation | Evidence required | Delay | Afterwards |
|---|---|---|---|
| Forgot the password, still has a passkey | A passkey sign-in, then a new password | None: this is replacement, not recovery | Notice to existing channels |
| Forgot the password, still has the authenticator app | An emailed reset link, one recovery code, with an app code from the authenticator she still holds | None | New password, notice to existing channels |
| Lost the phone, still has a backup passkey | A sign-in with the backup passkey | None | Remove the lost phone's methods, end its sessions, notice |
| Lost every authenticator, has saved codes | A saved recovery code and a code or link emailed to the registered address | 24 hours, cancellable | New authenticator, sessions ended, new codes, notices |
| Staff member who lost everything | Repeated proofing by video or in person, started by the help desk | None once proofed | New security keys, sessions ended, notices, manager informed |
| Account with a management role | In-person proofing and a second administrator's approval | None once approved | New security keys, review of recent actions |
On Monday, Mia took the fourth row: a code from the sheet at home and a reset link emailed to her personal address. The notices reached her registered address, nobody cancelled, and on Tuesday morning she set up the authenticator app on her new phone, chose a new password and printed a new set of codes. Had someone else held her code sheet and her mailbox, the day's delay would have given her notice time to stop them.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Recover Mia's account with two pieces of evidence and read the notices it sendsGive Mia an authenticator app and recovery codes at the Lab Inbox, then recover her account after a lost phone and a forgotten password with an emailed link and a saved code.