Repository navigation
Description
Context
When the owner deletes a passkey, the server only removes the row and revokes its sessions (app.delete("/auth/passkey/:id", packages/ui-server/src/middleware/passkeys.ts:608-619). The client only drops it from the list (onDelete, packages/ui-react/src/components/settings/passkey-tab.tsx:96-107). The credential manager on the phone keeps offering the deleted passkey, and every later attempt to use it fails.
The same happens at login. A credential the server does not know returns the same generic 401 { error: "Passkey verification failed" } as any other failure (fail, packages/ui-server/src/middleware/passkeys.ts:359-367). The client cannot tell "this passkey no longer exists here" apart from other failures.
The WebAuthn Signal API fixes both. Guide security/passkey-management:
- "The application MUST invoke
signalAllAcceptedCredentials()automatically when the management page loads". - "The application MUST invoke
signalAllAcceptedCredentials()immediately within your delete credential click handler post-fetch." - "All
userIdand credential ID parameters passed to Signal API methods … MUST be Base64URL-encoded strings."
Guide security/passkey-authentication: call signalUnknownCredential() only when the server reports the credential as not found "and the user is unauthenticated". That guide uses HTTP 404. This project keeps the documented 401 (docs/http-api.md, login-verify row) and adds a machine-readable code instead.
Support: Chrome Android 132 and Samsung Internet 29 have the Signal API. Firefox Android does not.
To signal, the client needs two values it does not have today:
- The RP ID.
GET /auth/passkey/listdeliberately returns rows for every RP (packages/ui-server/src/middleware/passkeys.ts:578-585). A signal must list only the current RP's credentials, or it hides valid ones. WhenWEBAUTHN_RP_IDis a parent domain, the RP ID also differs fromlocation.hostname. - The WebAuthn user handle:
WEBAUTHN_USER_IDencoded as UTF-8 (userId,packages/ui-server/src/middleware/passkeys.ts:89-91), sent as base64url.
The same gap causes a bug in the list. PasskeyList badges a row as foreign when credential.rpId !== location.hostname (packages/ui-react/src/components/settings/passkey-list.tsx:65). With a parent-domain WEBAUTHN_RP_ID, that badges every valid passkey.
Blocked by #2556
Scope
- Server, list:
GET /auth/passkey/listreturns{ credentials, rpId, userId }:rpIdis the RP ID the passkey ceremonies would use for this request. UseresolveRpwhen an Origin is present, otherwise the configured or derived read RP.userIdis the base64url of the WebAuthn user handle.credentialsis unchanged.
- Server, login-verify: when the asserted credential ID has no row for the current RP, return the same 401 with an added
code: "unknown_credential", but only after the response's challenge has been consumed as a live authentication challenge. A caller without a fresh challenge cannot use the code to probe which credential IDs exist. Every other 401 is unchanged and carries nocode. - Client, Security tab: after a successful list load, and after a successful delete followed by a list refresh, call
PublicKeyCredential.signalAllAcceptedCredentials({ rpId, userId, allAcceptedCredentialIds }). The IDs are those of rows whoserpId === response.rpId. Never signal from a failed or partial list. - Client, login: in both conditional and button flows, when verify fails with
code === "unknown_credential", callPublicKeyCredential.signalUnknownCredential({ rpId: <rpId from the request options>, credentialId: <base64url id> }). - Client, badge:
PasskeyListbadges foreign rows by comparingcredential.rpIdwith the list'srpId, not withlocation.hostname. - Feature-detect each Signal method. When a method is missing, skip the call silently. A rejected signal is logged at debug level and never shown to the user.
BrainApi.passkeyListreturn type gainsrpIdanduserId. Updatedocs/http-api.md(list row and login-verify 401).
Out of scope
- Changing the login-verify status from 401 to 404.
signalCurrentUserDetails. There is no account rename in this app.- Filtering the list response by RP. Foreign rows stay visible so stale credentials can be deleted.
- Two deployments with separate databases sharing one RP ID and user handle. That setup is unsupported: each one's signal would hide the other's passkeys. Note it in the
WEBAUTHN_USER_IDandWEBAUTHN_RP_IDdescriptions (packages/ui-server/src/config/env.ts:466-478).
Acceptance criteria
- Server tests in
packages/ui-server/tests/passkeys.test.ts:- The list returns
rpIdand the base64urluserId. - An unknown credential with a live challenge gets 401
{ error, code: "unknown_credential" }. - An unknown credential without a live challenge, and a failed signature, get 401 with no
code. - Each test fails before the change.
- The list returns
- Real-Chrome runtime test (CDP virtual authenticator, with
PublicKeyCredential.signalAllAcceptedCredentialsandsignalUnknownCredentialwrapped by an init script that records calls and restores descriptors):- Opening the Security tab records one
signalAllAcceptedCredentialscall with only current-RP IDs. - Deleting a passkey records a call without the deleted ID.
- Signing in with a virtual-authenticator credential whose row was deleted server-side records one
signalUnknownCredentialcall with that credential's base64url ID.
- Opening the Security tab records one
- Android/Firefox support: with both Signal methods deleted from
PublicKeyCredential, the same flows complete with no error UI and no thrown exception. Proven in the runtime suite. - With a parent-domain RP ID fixture, current-RP rows are not badged foreign.
- The PR records a mutation: signal with every row instead of current-RP rows, and watch the RP-filter assertion fail.
Verification
bun run test packages/ui-server/tests/passkeys.test.ts
bun run test packages/ui-react/tests/passkey-login-runtime.test.ts # BRAIN_REQUIRE_CHROME=1
bun run test
bun run api-report
bun run typecheck
bun run lintContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. Additive: two new list fields, one optional 401code, and theBrainApi.passkeyListreturn type. Updatedocs/http-api.md. - This changes a published package's behaviour, so it needs a changeset.
2026-10-22 triage at main aa8c8966b59f031f054f4876dbca84048b40ae4f: verified the all-RP list, current unknown-credential/challenge order, client delete and foreign-RP badge paths. Refreshed moved server pointers. The brief specifies scope, exclusions, offline/runtime proof and additive contract impact with no outstanding needs prerequisite, so add agent-ready alongside blocked. #2556 remains OPEN and is a real helper/lifecycle dependency; its p2 is at least this issue's p2. Native parent #2554 is retained. No Signal implementation or browser success is claimed.
Activity
schlessera commentedon Oct 22, 2026
2026-10-22 triage at main
aa8c8966b59f031f054f4876dbca84048b40ae4f: verified the all-RP list, current unknown-credential/challenge order, client delete and foreign-RP badge paths. Refreshed moved server pointers. The brief specifies scope, exclusions, offline/runtime proof and additive contract impact with no outstanding needs prerequisite, so add agent-ready alongside blocked. #2556 remains OPEN and is a real helper/lifecycle dependency; its p2 is at least this issue's p2. Native parent #2554 is retained. No Signal implementation or browser success is claimed.