Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

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 app 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 authentication 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 passkey 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:

Account recovery methods in NIST SP 800-63B-4
MethodWhat the person presentsKey requirements
Saved recovery codesA code issued earlier and kept by the personAt least 64 bits of randomness; stored hashed; each works once and is replaced after use
Issued recovery codesA code sent now to an address the person registeredAt least six digits; valid 10 minutes by text or voice, 24 hours by email, 21 or 30 days by post
Recovery contactsA code sent to someone the person trustsThe person can see and manage their contacts
Repeated identity proofingThe evidence from the original proofing, checked againOnly 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 proofing, if the account was proofed. An AAL3 account proofed in person at the highest identity assurance level 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 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 session 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.

A recovery that waits a day before it takes effect, so a notice to the old channels can stop it.

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-resistant sign-in for its staff but lets anyone who forgets their key receive an emailed link, a phishing 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:

Lab Photos' recovery design for accounts held to AAL2, and for staff
SituationEvidence requiredDelayAfterwards
Forgot the password, still has a passkeyA passkey sign-in, then a new passwordNone: this is replacement, not recoveryNotice to existing channels
Forgot the password, still has the authenticator appAn emailed reset link, one recovery code, with an app code from the authenticator she still holdsNoneNew password, notice to existing channels
Lost the phone, still has a backup passkeyA sign-in with the backup passkeyNoneRemove the lost phone's methods, end its sessions, notice
Lost every authenticator, has saved codesA saved recovery code and a code or link emailed to the registered address24 hours, cancellableNew authenticator, sessions ended, new codes, notices
Staff member who lost everythingRepeated proofing by video or in person, started by the help deskNone once proofedNew security keys, sessions ended, notices, manager informed
Account with a management roleIn-person proofing and a second administrator's approvalNone once approvedNew 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.

Lab Photos requires a passkey for every staff sign-in, and lets anyone who loses theirs recover with a link emailed to their personal address. How strong are its staff accounts? 1 of 3

Choose one answer.

Mia has lost her phone and her password, so every authenticator is gone. Which evidence meets NIST SP 800-63B-4's recovery requirement for her AAL2 account? 2 of 3

Choose one answer.

Someone completes recovery of Mia's account and registers a new email address on the way. Where should Lab Photos send the recovery notice? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity