Identity, Authentication, and Access Management Questions
Designing and operating identity and access control systems. Covers authentication protocols and standards (OAuth, SAML, OIDC, MFA), authorization models (RBAC, ABAC), identity lifecycle and privilege management, IAM architecture and automation, and access control across cloud and on-premises environments. The 'who can do what' control plane, distinct from cryptographic key management.
Evaluate centralized IAM versus decentralized/self-sovereign identity (SSI) for your enterprise. Discuss impacts on authentication flows, revocation and user lifecycle management, privacy, scalability, regulatory compliance, user experience, and migration challenges to a decentralized model.
Sample Answer
Direct answer
Centralized identity and access management (IAM) concentrates identity in one authority that every authentication checks against live, which buys immediate revocation, mature compliance patterns, and familiar usability at the cost of that authority seeing, and correlating, every access event across the enterprise. Decentralized or self-sovereign identity (SSI), where a user holds their own cryptographically signed credentials in a personal wallet and presents them directly to whoever is asking, buys genuine user-controlled privacy and issuer-independent verification at the cost of slower, less certain revocation, a materially less mature ecosystem, and a real new operational burden on the end user. For nearly every enterprise today, the honest conclusion is not "replace centralized IAM with SSI," but identifying the specific, narrow use cases where SSI's properties actually matter and keeping everything else on centralized IAM's more mature footing.
Structured elaboration
Authentication flows. Centralized IAM has a single flow: the user authenticates against one authority, which issues a session or token, simple to reason about but entirely dependent on that authority being reachable at the moment of login. SSI flows have the user present a cryptographically signed verifiable credential directly to a relying party, which checks the signature and, typically, a revocation status, without necessarily contacting the original issuer live; this can work even if the issuer's own systems happen to be offline, since the signature itself, not a live database lookup, is what's actually being verified. The trade-off: centralized is operationally simpler at the cost of one dependency every login relies on; SSI trades that single dependency for a genuinely more complex multi-party flow, wallet software, credential formats, revocation-status infrastructure, that most organizations have far less operational experience running today.
Revocation and user lifecycle management. Centralized revocation is immediate and complete: disable the account record, and every future authentication attempt fails right away. SSI revocation is architecturally harder, because the signed credential itself doesn't disappear when revoked; the issuer has to publish revocation status somewhere every verifier actually checks, and until that check happens, or the credential's own natural expiry passes, a revoked credential can still function against a verifier that skips the check. This is the same tension already familiar from stateless access tokens, a self-contained credential is not trivially killable the way a server-side session record is, just applied here at the whole-identity level rather than the single-token level. Centralized wins decisively on guaranteed, immediate revocation.
Privacy. A centralized authority sees every authentication event across every application relying on it, building a complete picture of a user's activity in one place, and a single breach there exposes everything correlated inside it. SSI is designed to let a user disclose only the specific attribute a verifier actually needs, proving they are over a certain age without revealing their exact birthdate, or proving current employment without revealing salary, and the original issuer doesn't necessarily learn when or to whom the credential was later shown. This selective-disclosure property is SSI's strongest genuine advantage, but it depends entirely on actually using credential formats and wallets built to support it; an implementation that just presents the whole credential every time gives up most of this benefit while still taking on SSI's other costs.
Scalability. Centralized IAM is proven at massive scale, essentially how every large enterprise and cloud platform already operates, though the authority itself needs its own scaling and high-availability design since every authentication passes through it. SSI verification that only checks a signature and a revocation-status source can, in principle, scale well per verification without a live round-trip to the issuer, but the surrounding ecosystem, wallet adoption, credential-format standardization across issuers and verifiers, and revocation-infrastructure reliability, is comparatively immature and far less battle-tested at enterprise scale today.
Regulatory compliance. Centralized IAM has well-understood compliance patterns: access reviews, centralized audit logs, and a clear data-controller relationship that auditors and regulators already recognize. SSI raises genuinely open questions for regulations that require a clear controller-processor relationship and a mechanism for correcting or erasing personal data, since a credential the user holds themselves complicates who is accountable for honoring that kind of request when the organization doesn't unilaterally hold the record it would need to act on. This is a real, still-evolving area, not a solved compliance pattern, and adopting SSI today needs specific legal review of how existing regulatory obligations actually map onto a model where the organization no longer holds the record outright.
User experience. Centralized IAM gives a familiar single-login experience, but the user has no real control over what's collected about them beyond the organization's own policy, and losing access to that one account is a single point of friction for the user as much as for the organization. SSI gives the user genuine control, they hold their own credentials and choose what to disclose, but requires them to manage a wallet, understand credential presentation, and handle their own backup and recovery if the wallet or its keys are lost, a materially higher burden today than typing a password. Centralized wins on day-one usability for most people; SSI's control benefit is real but shifts operational burden onto a user population that is not yet broadly accustomed to managing their own credential wallet.
Migration challenges to a decentralized model. No enterprise runs on zero legacy centralized IAM today, so this is a coexistence and bridging problem, not a clean cutover. Applications need to accept both traditional tokens and verifiable credentials during any transition; users need a path to acquire an initial credential, often bootstrapped from their existing centralized identity, the organization issuing someone's first verifiable credential based on an identity it has already verified through its own centralized system; and the organization has to decide deliberately which use cases actually benefit from SSI's properties, portability across organizations, issuer-independent verification, versus which are better left on centralized IAM, where the organization already fully controls both ends of the relationship and immediate revocation actually matters more than portability.
Worked example
"Fernbridge Corp" pilots a single, narrow SSI use case rather than a wholesale replacement. When an employee departs, Fernbridge issues them a verifiable "proof of past employment" credential, cryptographically signed, that the former employee keeps in their own wallet and can present directly to a future employer's background-check process. This removes Fernbridge's own HR team from fielding manual verification phone calls for years after someone leaves, and the former employee controls exactly what gets disclosed, dates of employment and title, without exposing salary history unless they specifically choose to. Everything else at Fernbridge, every internal application, every system a current employee touches day to day, stays on centralized IAM, because those use cases need what centralized IAM is actually good at: immediate revocation the moment someone is terminated, and a single, already-mature audit trail the security team already knows how to review. The pilot succeeds specifically because Fernbridge identified one use case where SSI's properties, portability beyond any single relationship, and independence from Fernbridge's own systems being reachable years later, mattered more than centralized IAM's revocation speed, rather than trying to move everything at once.
| Dimension | Centralized IAM | Decentralized/self-sovereign identity |
|---|---|---|
| Authentication flow | Single authority, live check | Cryptographic credential, checked locally plus a revocation-status lookup |
| Revocation | Immediate and guaranteed | Depends on the verifier actually checking published revocation status |
| Privacy | Central authority sees and correlates everything | Selective disclosure possible, but only if implemented correctly |
| Scalability | Proven at enterprise scale today | Verification scales well in principle; ecosystem maturity lags |
| Regulatory compliance | Mature, well-understood patterns | Genuinely open questions around controller/processor accountability |
| User experience | Familiar, low burden, no user control | User control, but real wallet-management and recovery burden |
| Migration | N/A, the existing baseline | Requires coexistence, bootstrapping from existing identity, and use-case selection |
Trade-offs and pitfalls
The most common strategic mistake is treating SSI as an all-or-nothing replacement for centralized IAM rather than a tool for the specific use cases where its properties actually matter; most enterprise internal access control needs immediate revocation and centralized audit far more than it needs credential portability. Underestimating the revocation-latency gap is a specific version of the same mistake: assuming a revoked credential is functionally dead the instant revocation is issued, when it actually depends on every verifier faithfully checking revocation status, which is not yet universal practice across the ecosystem. Adopting SSI for its privacy story while implementing it in a way that presents the entire credential every time, rather than using genuine selective disclosure, gives up the real privacy benefit while still absorbing all of SSI's operational and user-experience cost. Finally, underestimating the wallet-recovery and key-loss problem for an average user population is a real adoption blocker that a narrow technical pilot, run against a small, technically sophisticated group, can easily overlook until the model is rolled out to a genuinely broad population.
An attacker has replaced a user's ~/.ssh/authorized_keys across multiple servers to maintain persistent access. Describe how you would identify which keys were added and when, what logs and artefacts you would inspect across systems (including auditd, filesystem timestamps, configuration management), and how you would coordinate an automated, auditable rotation of that user's keys across the fleet.
Sample Answer
Direct answer
Because file timestamps and the authorized_keys file's own content can both be altered by whoever already has write access to them, the trustworthy evidence has to come from sources the attacker cannot also silently edit: auditd records (if file-integrity watches were configured before the compromise), your configuration-management tool's own run history (which independently records what it last confirmed was correct, on its own schedule, not the file's), and centralized authentication logs showing which key fingerprint was actually used to log in and when. Once you know which keys are illegitimate and roughly when they were added, coordinate rotation as one auditable, fleet-wide change rather than fixing hosts one at a time as you find them.
Structured elaboration
Identifying which keys were added, and when
auditd, if a watch rule was already in place on~/.ssh/authorized_keys(-w /home/*/.ssh/authorized_keys -p wa), gives you the actual write events with timestamps and the process/user that performed them; this is the strongest evidence because it is generated at the time of the change, not reconstructed afterward.- Filesystem timestamps (
staton the file) are useful corroboration but are the weakest evidence on their own: an attacker who can write the file can also often touch it to alter its recorded modification time, and a legitimate later edit by anyone else will also update the same timestamp, so timestamps alone cannot distinguish a legitimate change from the attacker's. - Configuration-management run history (Ansible, Puppet, Chef, Salt) records the LAST TIME the tool confirmed the file matched its managed state, independent of the file's own metadata; a gap between the tool's last confirmed-good run and now, combined with the file no longer matching what the tool manages, brackets the window during which the unauthorized change happened.
- Centralized SSH authentication logs (aggregated via your SIEM, not just each host's local
/var/log/auth.log) show the key fingerprint presented on each login; comparing fingerprints against your known-good key inventory identifies exactly which key the attacker added and every host where it was subsequently used to log in.
Scoping which hosts are affected
Before assuming only the hosts with direct evidence of a modified authorized_keys are compromised, trace how the attacker obtained write access to that file in the first place (a stolen credential, a vulnerable service, a compromised configuration-management control plane). If the entry point could plausibly reach other hosts (for example, a compromised configuration-management server that pushes to the whole fleet, or a shared jump host), those hosts need the same evidence review even without a directly observed modified file yet, since the absence of evidence on a host you haven't checked is not evidence of absence.
Coordinating an automated, auditable rotation
- Generate a fresh keypair for the affected user, distributed through the same configuration-management system that manages
authorized_keysnormally (so the distribution itself is logged and auditable), rather than manually editing files on each host. - Push the new key to the entire fleet in one coordinated run, then explicitly remove ALL previously trusted keys for that user (not just the one identified as the attacker's addition), since a targeted user's other keys may also have been copied or otherwise compromised during the same incident.
- Force a reconciliation run of the configuration-management tool immediately after, so any host where the attacker's key was manually re-added out-of-band (bypassing the normal management path) gets flagged as drifted rather than silently keeping the stale malicious key.
- Record the whole rotation (which hosts, which keys removed, which key added, timestamps) as its own auditable change, both to close out the incident and to have a clean baseline if the same investigation needs to be repeated later.
Trade-offs and pitfalls
The pitfall that extends an incident longest is scoping the fix to only the hosts where you happened to find direct evidence, when the actual exposure is defined by how the attacker got write access in the first place, not by which hosts you got around to checking. A close second is rotating the compromised key without also removing the user's OTHER existing keys, on the assumption only the newly discovered key is malicious; if the initial compromise came from a stolen credential or workstation, any key that existed at the same time should be treated as suspect, not just the one you can directly attribute.
Design a secure break-glass process for emergency privileged access that minimizes risk of abuse. Include required approvals, ephemeral credential issuance, session brokering/recording, forced post-usage attestation, cryptographic one-time tokens, and integration with SSO and PAM while maintaining forensic-grade audit trails.
Sample Answer
Direct answer
Break-glass design has to resolve one paradox: the access must be fast enough to be actually usable during a real emergency, yet harder to abuse than the normal privileged-access path it bypasses. The way to resolve it is to stop trying to control abuse at the moment of the request (which is inherently time-pressured and cannot bear much friction) and instead concentrate every control on what happens when the access is used: required approval that runs in parallel with issuance rather than blocking it, a single-use ephemeral credential, a fully brokered and recorded session, and a mandatory after-the-fact accounting that the requester cannot skip.
Structured elaboration
Trigger and required approvals. A requester invokes emergency access through the normal single sign-on (SSO, one login trusted across many applications) portal, authenticated with multi-factor authentication (MFA, proving identity with more than one independent factor, such as a password plus a hardware token). Two approval shapes are common and can be combined: a fast-track that grants access immediately for genuinely time-critical cases but requires a secondary on-call approver to be notified in parallel (their approval is recorded even though it did not gate the grant), and a gated path for less time-critical emergencies that waits for that approval within a short SLA (for example 5 minutes) before falling back automatically to a named secondary approver group so the request is never blocked by one unavailable person.
Ephemeral credential issuance. The credential minted for the session is scoped to exactly the target system and action needed, valid for a short fixed window (commonly 15-60 minutes), and never handed to the user directly: it is held by the session broker (below) and used on the requester's behalf. This bounds the blast radius of a stolen or leaked credential to a window that has almost certainly already closed by the time anyone could misuse it.
Cryptographic one-time tokens. The approval step produces a signed, single-use token, conceptually a JSON Web Token (JWT)-style structure: a payload naming the requester, the target, the approval chain, and an expiry, plus a cryptographic signature over that payload. Because it is single-use and bound to the specific session (via a nonce, a random value used exactly once to prevent replay) and ideally to the requesting device's own attested identity, a captured token cannot be replayed to open a second, unauthorized session.
Session brokering and recording. All privileged access flows through a broker (a jump host or proxy) rather than directly to the target system. The broker holds the actual ephemeral credential, enforces command filtering (blocking or flagging destructive commands outside the stated emergency scope), and records the session (keystrokes and, where feasible, screen video). This is what converts "trust the engineer" into "verify what the engineer did," and it is what makes the subsequent audit trail forensic-grade rather than a self-reported summary.
Forced post-usage attestation. When the session ends, the requester must submit a short structured attestation (what was done, why, and the outcome) within a fixed SLA (for example, 4 hours). Missing that deadline is not a soft reminder: it should automatically disable the account and open a security incident, because an emergency real enough to justify bypassing normal access controls is also real enough to justify a mandatory accounting of what happened.
Integration with SSO and PAM. SSO supplies the identity and MFA at the front door; privileged access management (PAM, the system that vaults, brokers, and rotates privileged credentials) supplies the actual credential vaulting, session brokering, and rotation. Break-glass is best understood as a specific, heavily-instrumented mode of the same PAM infrastructure used for routine privileged access, not a separate system with its own credential store to keep in sync.
Forensic-grade audit trails. Every event (request, approval decision, token issuance, session start and every recorded action, attestation submission or its absence) is written to an append-only store, ideally with per-event cryptographic signing or a periodically-published hash chain, so a tampering attempt after the fact is detectable rather than merely against policy. This is shipped to the security information and event management (SIEM) platform so it feeds both real-time alerting and later incident review from the same source of truth.
Worked example
sequenceDiagram
participant U as On-call Engineer
participant S as SSO with MFA
participant G as Gating Policy Engine
participant AP as Approver
participant PAM as PAM Credential Vault
participant B as Session Broker
participant L as Immutable Audit Log
U->>S: Authenticate with MFA
U->>G: Request emergency access plus reason
G->>AP: Notify for approval, SLA timer running
AP-->>G: Approve
G->>PAM: Mint one-time cryptographic token
PAM-->>U: Ephemeral credential, held by broker only
U->>B: Connect via broker using token
B->>L: Stream session recording and command log
Note over U,B: Session ends
U->>B: Submit post-usage attestation
B->>L: Attestation recorded, or auto-disable if missed
Concretely: at 02:14 an on-call site reliability engineer (SRE) invokes break-glass on an internal administrative portal during a production outage, authenticating with MFA. The gating engine notifies the secondary on-call as required approver; the fast-track path grants the SRE a session immediately (the outage is actively causing customer impact) while the approval request runs in parallel with a 5-minute SLA. At 02:16 the secondary on-call approves from their phone; this approval is logged even though it did not block the grant. The PAM vault mints a token scoped to the one affected production host, valid until 02:44 (30 minutes). All commands the SRE runs are proxied and recorded by the broker. At 02:41 the outage is resolved and the session is closed. By 06:41 (a 4-hour attestation SLA), the SRE must have submitted what was done and why; if that has not happened, the account is automatically disabled and a security incident is opened, independent of whether the emergency access itself was legitimate.
Trade-offs and pitfalls
The core trade-off is exactly the paradox in the direct answer: a fully gated approval (wait for a human before any access) is more resistant to abuse but can fail the emergency it exists to serve if the approver is asleep or unreachable, while a fully ungranted "trust and record" fast-track is more available but leans entirely on after-the-fact detection. Most mature designs use the fast-track for genuinely time-critical categories and the gated path with an automatic fallback approver group for everything else, rather than picking one mode for all emergencies.
A common pitfall is treating the frequency of break-glass invocations as noise instead of a signal: if a team invokes it every week, that is not an emergency-access system working correctly, it is a sign that the normal just-in-time elevation process is too slow or too narrow, and every invocation should be reviewed with that question in mind, not just for individual abuse.
A second pitfall is a soft attestation SLA: "please fill this out when you get a chance" reliably decays to never, at which point the forensic trail has a hole exactly where it matters most. The auto-disable consequence has to be real and automatic, not a manager follow-up email, or the control exists on paper only.
A third pitfall is issuing the ephemeral credential directly to the user instead of keeping it broker-held: a credential the user can see and copy can be exfiltrated even if it is short-lived and single-use, defeating the point of not persisting long-lived secrets. The broker-held pattern (the user authenticates to the broker, the broker authenticates to the target) is what actually prevents this, and it is worth calling out explicitly because it is easy to design a "correct-looking" flow that quietly hands the secret to the wrong party.
An internal intermediate CA used by your organization is suspected compromised. Draft an incident response plan covering containment, determining scope, revoking affected certificates, notifying stakeholders and external parties, re-issuing certificates, minimizing service disruption, updating trust stores, and post-incident changes to PKI design (e.g., offline root, automated rotation, short-lived certs).
Sample Answer
Direct answer
Treat a suspected intermediate CA (certificate authority) compromise as an active incident, not a slow investigation. Contain first, by stopping the suspect CA from issuing anything new, then determine scope, since every certificate it issued during the exposure window is now suspect, then revoke and re-issue in that order, communicate to affected parties as scope becomes clear, and only after the immediate incident is resolved, redesign the PKI (public key infrastructure) so this class of compromise is structurally harder to repeat.
Structured elaboration
flowchart LR
A[Contain: disable the suspect CA] --> B[Determine scope: bound the exposure window]
B --> C[Revoke: update CRL and OCSP, revoke the CA certificate]
C --> D[Notify: internal and external stakeholders]
D --> E[Reissue and deploy replacements]
E --> F[Update trust stores fleet-wide]
F --> G[Post-incident redesign: offline root, automation, short lifetimes]
Containment. Immediately revoke or disable the suspect intermediate CA's signing capability: if it's HSM-backed (hardware security module), disable or suspend the key handle; if it's a software process, take it offline. The goal is to stop any new certificate being issued under a key you no longer trust, before the investigation is even finished. Contain to the blast radius you actually have evidence for; don't touch the root or unrelated intermediates unless evidence points there too.
Determining scope. Every certificate that CA ever signed is suspect until proven otherwise; you cannot assume the compromise "started recently" without evidence. Pull every available signal, HSM audit logs, CA issuance logs, and access logs to the CA's host or service, to bound the actual exposure window. Pull the full issuance log (every certificate's serial number, subject, and issued-at time) for that window, or for the CA's entire operational lifetime if the window can't be bounded confidently. Classify affected certificates by criticality and exposure (public-facing TLS versus internal service certs versus client certs), since both remediation priority and external-notification obligations differ.
Revoking affected certificates. Publish revocation for every certificate identified in scope: update the CRL (certificate revocation list) and the OCSP (Online Certificate Status Protocol) responder status for the intermediate's entire issued set, or the bounded exposure subset. Revoke the intermediate CA's own certificate too, so any new certificate chaining to it is untrusted by any verifier that properly checks the chain, even if an attacker somehow retains signing capability.
Notifying stakeholders and external parties. Internally: security leadership, every team owning an affected service from the scope list, and incident command. Externally: this depends on what the affected certificates chain to. Since this is described as an internal intermediate CA, the CA/Browser Forum baseline-requirement reporting obligations that apply to publicly-trusted CAs most likely don't apply directly here, but any external partner whose systems were told to trust your internal root still needs to hear from you, and your organization's own breach-notification policy should be consulted for anything touching regulated data.
Re-issuing certificates. For every revoked certificate, issue a replacement under a new, uncompromised intermediate CA, not the same key under investigation; reissuing under the still-suspect key before you're confident it's clean just recreates the same exposure. Sequence reissuance to prioritize the highest-criticality, most externally-exposed services first.
Minimizing service disruption. There's a real tension here: revocation should take effect immediately for security, but every service legitimately relying on a certificate you're about to revoke needs its replacement ready at roughly the same time, or it goes down. Sequence it as: stand up the new intermediate CA, pre-issue replacement certificates for the highest-priority services, deploy those replacements, then revoke the old certificates for those specific services, and repeat in waves for the rest. This differs from the graceful, long-soak rollover used for a routine rotation precisely because here you can't afford that long window; you're actively closing an active exposure, so some services face a harder cutover than a routine rotation would ever require. Communicate a cutover window to affected service owners even though this is an incident, since a batch of simultaneous certificate swaps is itself an operational risk.
Updating trust stores. Every verifier, client, service, load balancer, or partner system, that has the intermediate's certificate or chain cached or pinned needs the updated chain distributed. Anything doing certificate pinning specifically to the old intermediate's public key will hard-fail until updated, so identify and fix pinned configurations as part of the rollout, not after. If scope investigation reveals the root itself was also touched, every trust store fleet-wide needs the new root, a much larger, slower operation, which is exactly why bounding scope correctly matters as much as it does.
Post-incident changes to PKI design. Move the root CA fully offline if it wasn't already, so a future intermediate compromise can't cascade into a root compromise through any operational coupling. Adopt automated rotation for issuing CAs and downstream leaf certificates, since a manual process is likely part of what let this exposure window grow undetected, and is also what makes recovery slow. Move to short-lived leaf certificates, so even a future undetected compromise has a naturally bounded blast radius, rather than depending entirely on detection and revocation working perfectly, which this very incident demonstrates isn't guaranteed. Add or strengthen HSM-backed key storage and audit logging on issuance operations, so scope determination in any future incident is fast and confident rather than the forensic scramble it likely was this time.
Worked example
Suppose issuance logs show the intermediate CA issued 1,400 certificates over its lifetime (an illustrative figure for this walkthrough), and audit logs bound the suspected exposure window to the most recent 10 days, during which it issued 60 certificates. Those 60 are the confirmed in-scope set; the remaining 1,340 are lower priority but not automatically cleared, and should be revisited if the exposure-window bound turns out to be wrong. Of the 60 in scope, suppose 8 are public-facing TLS endpoints and 52 are internal service-to-service client certificates (8 + 52 = 60). The 8 public-facing certificates get emergency reissuance and swap within the first few hours, since they carry the highest exposure and are most likely to be actively exploited by an external attacker; the remaining 52 follow in staged waves afterward.
Trade-offs and pitfalls
Revoking before replacements are ready, a common instinct once something is confirmed compromised, causes a self-inflicted outage across every legitimately-operating service using that CA's certificates. Once genuinely contained, the marginal extra hours of an already-contained compromise are usually less costly than a full service outage.
Assuming the exposure window is simply "since we detected it," rather than doing real forensic work to bound it, leaves some actually-compromised certificates un-revoked.
Reissuing under the same still-under-investigation intermediate, instead of standing up a clean one, is a common shortcut that recreates the exposure.
Treating this purely as a technical problem and skipping stakeholder or external notification can be a compliance and trust failure independent of how clean the technical remediation was.
Fixing the immediate incident without the post-incident redesign leaves the same class of incident, or a slower, undetected version of it, likely to recur.
Provide a comprehensive threat model for deploying WebAuthn/FIDO2-based passwordless authentication supporting both roaming authenticators (security keys) and platform authenticators (TPM, Secure Enclave). Address phishing resistance, lost/stolen devices, account recovery, credential migration between devices, attestation privacy, and server-side verification of attestation objects.
Sample Answer
Direct answer
WebAuthn (the Web Authentication API) and FIDO2 (Fast IDentity Online 2) replace shared secrets with public-key cryptography: an authenticator (a roaming security key like a YubiKey, or a platform authenticator like a phone's Secure Enclave or a laptop's TPM, a Trusted Platform Module chip that stores keys in hardware) generates a key pair per site, keeps the private key non-exportable, and the server only ever stores a public key plus a credential ID. This structurally defeats phishing, because the browser cryptographically binds the signed challenge to the origin the user is actually on, so a lookalike domain cannot get a valid signature even if the user is fooled into visiting it. The real threat-modeling work is everywhere WebAuthn's guarantees stop: device loss, account recovery, moving credentials between devices, what attestation is allowed to reveal about the user, and whether the server actually checks what it claims to check.
Structured elaboration
Roaming vs platform authenticators, and why the distinction matters for the threat model. A roaming authenticator (a physical security key connected over USB, NFC, or Bluetooth) is portable across devices but can be physically lost or stolen; a platform authenticator binds the private key to one device's hardware root of trust (Secure Enclave on Apple devices, TPM on Windows, StrongBox on Android) and cannot be moved by extracting the key, but ties the user to that specific device unless a synced-passkey mechanism is layered on top. Each shape produces a different recovery problem, which is why "account recovery" and "credential migration" have to be answered separately for each.
Phishing resistance. The core guarantee comes from the browser including the requesting origin in the data it asks the authenticator to sign; the authenticator's signature is over that origin, not just a code the user could copy into any site. A phishing site at attacker.example can relay the user's password and even a TOTP code to the real site, but it cannot get the authenticator to produce a valid signature for real-bank.example, because the browser and authenticator, not the user, are the ones binding the ceremony to the origin. This is the property TOTP and SMS OTP cannot offer at all. The residual risk is not phishing of the credential itself, but phishing that convinces a user to approve a legitimate-looking prompt for the wrong reason (a "second-order" social-engineering risk, mitigated by clear, consistent UI copy at the relying party, not by the protocol).
Lost or stolen devices. For a roaming key, theft plus knowledge of the site removes any protection unless the key itself requires a PIN or biometric to unlock (FIDO2's user-verification step); losing the sole registered authenticator with no backup locks the user out entirely. For a platform authenticator, device theft is mitigated by the device's own lock screen gating access to the Secure Enclave or TPM, but a device that is stolen unlocked, or where the OS lock is bypassed, exposes the same risk. The correct design response in both cases is the same principle applied twice: never let a user register only one authenticator, and always pair passwordless auth with a recovery path that is itself hardened (see next).
Account recovery. This is the single hardest problem in a well-designed passwordless system, because the whole point of the design is that there is no password to fall back to. Two shapes of answer exist and a mature design uses both: (1) require enrollment of a second, independent authenticator (a second security key kept in a safe, or a platform authenticator on a second device) at registration time, so recovery is "authenticate with your backup factor," not a separate weaker path; and (2) an explicit, deliberately slower human-mediated fallback (identity verification against existing account data, a waiting period, notification to the user's existing verified email or phone before the recovery takes effect) for the case where every registered authenticator really is gone. The trade-off is that any fallback path that is easier to pass than the primary authenticator becomes the attacker's preferred target, which is exactly the fallback-abuse problem discussed below.
Credential migration between devices. A private key generated inside a Secure Enclave or TPM is, by design, non-exportable; you cannot "copy" a FIDO2 credential the way you can copy a file. Two legitimate migration paths exist: (a) register a new authenticator on the new device as an additional credential while the old one is still available, then remove the old one, which requires the user to still have access to the old device at migration time; or (b) rely on a platform-level synced passkey mechanism (where the vendor's account system, not the individual device's secure hardware, is the unit of key custody, and the private key material is synced end-to-end-encrypted across a user's own devices). Synced passkeys trade a small amount of the "even the vendor cannot exfiltrate this key" guarantee of a strict hardware-bound credential for dramatically better recoverability, and that trade-off should be named explicitly rather than assumed away.
Attestation privacy. During registration, an authenticator can optionally provide an attestation statement, a signed claim about what make and model of authenticator generated the key, so the relying party can decide whether to trust that class of device. The privacy risk is that attestation, if not handled carefully, can be a device fingerprint: if every authenticator of a given batch presents the same attestation certificate, or if the relying party requests a level of detail that uniquely identifies the physical key, the server gains a tracking signal it does not need for the security decision it is actually making. FIDO2 addresses this via "batch attestation" (many authenticators from one manufacturing batch sharing one attestation certificate, so no individual key is distinguishable) and the option for "none" or "self" attestation when the relying party does not need manufacturer-level assurance at all.
Server-side verification of attestation objects. This is the step where a real implementation most often silently fails to deliver the security the protocol promises. Verifying a registration response correctly requires checking, at minimum: the signature over the attestation object is valid for the claimed attestation format; the client data's origin and challenge match what the server issued (and the challenge was single-use and not replayed); the relying party ID hash matches the expected domain; the user-verification and user-presence flags in the authenticator data reflect the policy the server actually wants enforced (for example, requiring user verification, not merely presence, if step-up authentication is the goal); and the credential ID being registered is not already bound to a different account. A server that accepts an attestation object without validating the signature chain, or that does not pin the expected origin, has implemented "something that looks like WebAuthn" without the guarantee that makes WebAuthn worth using.
The FIDO2-primary-with-OTP-fallback design and its abuse angle. A common real-world deployment is FIDO2 as the primary factor with a one-time-password (OTP) mechanism, TOTP or SMS, kept as a fallback for users who have not yet enrolled a second authenticator or whose only authenticator is unavailable. This directly reintroduces the phishing and MITM weaknesses that FIDO2 exists to remove, because an attacker who cannot phish the FIDO2 ceremony can instead phish or social-engineer the fallback path if the server treats it as an equally trusted route into the account. The concrete abuse pattern is a downgrade attack: the attacker triggers or waits for the fallback option to appear (for example, by claiming to have lost their key), then phishes the OTP instead of the passkey. Mitigations that actually close this gap: never offer OTP fallback silently at login time as an equal alternative on the same screen as the passkey prompt; require the fallback path to go through a distinct, monitored, and rate-limited recovery flow rather than a normal sign-in option; log and alert on every fallback-path usage as a materially higher-risk event than a passkey sign-in, since it should be rare by design; and consider requiring an additional out-of-band confirmation (a push to a previously-trusted device, or a delay with notification) before an OTP-only sign-in is honored on an account that has a FIDO2 credential registered.
Worked example
Consider a SaaS product enrolling a user with one platform authenticator (their laptop's TPM) as the primary credential and SMS OTP as the stated fallback.
- Registration: the server issues a random, single-use challenge. The browser asks the TPM to generate a key pair scoped to the relying party ID (the site's domain) and returns a public key, credential ID, and an attestation object (using "none" attestation here, since the deployment does not need manufacturer assurance). The server verifies the challenge matches, the origin matches, and stores
{credential_id, public_key, sign_count: 0}against the account. No shared secret exists anywhere. - Authentication: the server issues a new single-use challenge. The TPM signs
{challenge, origin, rpIdHash}with the stored private key. The server verifies the signature against the stored public key and checks the origin field equalshttps://app.example.comexactly; if the user is actually onhttps://app-example.com(a lookalike), the browser would have sent that origin to the authenticator, the resulting signature would be valid only for the lookalike origin, and the real server's check against its own expected origin fails closed. This is the mechanical reason phishing cannot succeed here, not a policy choice, a cryptographic one. - Fallback abuse scenario: an attacker who has the user's phone number attempts a SIM-swap or SMS interception and then claims (in a phishing call or on the login page) that the user "lost their laptop," triggering the SMS OTP fallback. If the server treats a correct OTP as sufficient to log in regardless of whether a FIDO2 credential is on file, the attacker walks in through the weaker path despite the account having a phishing-resistant credential registered. The fix demonstrated above (routing fallback through a separate, rate-limited, monitored recovery flow with out-of-band confirmation, rather than an equal-weight login option) is what prevents this from being a standing, low-effort bypass of the FIDO2 protection the account otherwise has.
Trade-offs and pitfalls
- Synced (multi-device) passkeys vs single-device hardware-bound credentials is the central design trade-off in this space: synced passkeys dramatically reduce lockout and support-ticket volume from lost devices, at the cost of moving key custody partly to the platform vendor's account system rather than a single piece of hardware; a security-sensitive deployment (banking, admin consoles) may deliberately require hardware-bound, non-exportable credentials and accept the higher recovery friction that implies.
- Attestation is easy to over-collect. Requesting full attestation detail "just in case" creates a tracking surface with no corresponding security benefit for most relying parties; only request the attestation level actually needed for a documented trust decision (for example, an enterprise requiring a specific certified hardware key model).
- The most damaging pitfall is exactly the fallback problem above: any fallback path that is easier to compromise than the primary factor becomes the attacker's real target, no matter how strong the primary factor is. A threat model that carefully hardens the passkey ceremony and then leaves an unmonitored OTP fallback as an equally-weighted login option has not actually raised the bar for the account overall.
- Skipping server-side attestation/origin verification is a common implementation shortcut that quietly discards the protocol's core guarantee; a server that trusts whatever the client sends without validating signatures and origins has built something that looks like WebAuthn in the UI but offers none of its phishing resistance.
- Single-authenticator enrollment is a recoverability trap: without a second registered authenticator or a deliberate human-mediated recovery path, a lost device becomes a permanent lockout, which in practice pushes real deployments back toward weaker fallback mechanisms out of support pressure, exactly the tension this answer's fallback-abuse discussion is about.
Unlock Full Question Bank
Get access to all Identity, Authentication, and Access Management interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.