Open
Description
WebAuthn is likely going to move toward a WebAuthn-specific error rather than trying to fit in existing DOMException type errors. That makes sense to me, and we need to support more than just WebAuthn errors, so we should return our own errors that can be mapped by clients to WebAuthn errors.
We should be careful to preserve the privacy properties that the current errors exhibit: an unprivileged caller should not be able to learn that a user has or does not have credentials without their consent.
Metadata
Metadata
Assignees
Labels
No labels
Activity
iinuwa commentedon Sep 7, 2026
ConstraintErrorcould be split intoUserVerificationUnsatisfiableandDiscoverableCredentialUnsatisfiable(or something with a better name)SecurityErrorcan beInvalidOriginSecurityErrorfor our own internal purposes, like untrusted caller, which can be a separate error too)TypeErrorcan be split intoInvalidUserIdandInvalidOptionsNotAllowedError, or maybeCeremonyErrorI guess essentially everything that could have been deduced from the caller-supplied parameters can be returned back to the caller as a specific error, but if it has to do with user action that may or may not have taken place, it should be hidden. I'm not sure if any other specific errors would be helpful for browsers.
The only other one I can think of is that
TimeoutErrorcould be an explicit error for unprivileged clients, as a caller could use side channel to guess whether it was a timeout or explicit cancellation anyway, and it's useful to show different errors to the user in a timeout case vs. cancellation.daemon: Return descriptive errors from the gateway
daemon: Return descriptive errors from the gateway
abergmeier commentedon Nov 19, 2026
For Gnome Control Center I would not mind getting
CredentialExcludedas a direct feedback.iinuwa commentedon Nov 19, 2026
yeah, that's currently represented as InvalidStateError and is missing in the above list.
daemon: Return descriptive errors from the gateway
daemon: Tell privileged clients why a ceremony failed
kpanuragh commentedon Nov 21, 2026
I looked at how other platforms give browsers more detail than websites get, to pick which errors privileged clients should see after #260.
The spec direction. The WebAuthn WG is working on finer-grained errors for websites in w3c/webauthn#2096 (open, L4 milestone, draft PR w3c/webauthn#2095). All of them are returned only after the user has interacted with the browser's UI:
UserCancelledError: the user cancelledUserVerificationError: no UV-capable authenticator, or PIN/biometric failedTimeoutError: the user walked away until the ceremony timed outHybridPrerequisitesError: hybrid isn't possible (e.g. Bluetooth off), and the user cancelled after being toldUserHybridCancelError: the user cancelled at the hybrid QR code stepA
NoCredentialsErrorwas proposed earlier (w3c/webauthn#2062) and dropped because a maliciousget()could use it to fingerprint users.Other platforms. Windows'
webauthn.dllgives browsers the raw HRESULTs (NTE_USER_CANCELLED,NTE_NOT_FOUND,NTE_EXISTS, …) andWebAuthNGetW3CExceptionDOMErrorcollapses them to DOM errors for the website. That's the same split as privileged/unprivileged here. Android's Credential Manager has separate cancellation, interrupted, no-credential and provider-configuration exceptions. Apple folds most detail intofailed.Proposal. Give privileged clients the errors that map to the #2096 set, with every other caller still getting
NotAllowed. #260 now does this forUserCancelled(plusInternal). The others could be small follow-ups:Timeout: credentialsd doesn't enforce the request'stimeoutoption today; the only limit is libwebauthn's 300 s wait for user presence, which ends up as an internal error. Honouringtimeoutand returningTimeoutwould fix that too.UserVerificationFailed: when the user cancels after a PIN/UV problem in that request (PinAttemptsExhausted,PinNotSet, wrong PIN). This needs the daemon to remember the last device error per request.HybridUnavailable: when the user cancels after hybrid was marked unavailable (TransportUnavailable).I'd keep "no credentials" hidden from every caller, browsers included, so a browser that forwards errors too freely can't leak it. I'd also leave the hybrid-QR cancel case for later, since it needs the UI to report which view was active.
Does that direction sound right? If so I'll start with the timeout one.