Security key required to sign in on a new device (Phase 2 of #989) #38
Loading…
Reference in a new issue
No description provided.
Delete branch "board/989-aaf0c7"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 2 of #989: an account can require a security key to sign in on a new device, on top of the password and Secret Key. End-to-end encryption is unchanged; this guards session issuance only (DESIGN "Signing in with a security key").
How it works
plaintext/v1/signin-keys ‖ id ‖ ts ‖ host ‖ SHA-256(action)), so neither a stolen session nor an admin can change them. There's no admin path.SHA-256("plaintext/v1/signin-key-add" ‖ id ‖ ts). No attestation. ES256 and EdDSA, at most 10 keys.keycarries apendingid that only this client gets, a challenge, and the credential ids.POST /v1/login/finishtakes an assertion, a recovery code, or nothing once the approval page has approved. Failed attempts count against the failed-login limiter.trusttoken, stored hashed. Later logins that carry it skip the key, never the signed login. A password change wipes them. Without this the extension and the CLI would need the key on every unlock./v1/login/key#<challenge>, strict CSP, no framing). There the RP ID is the page's own host./v1/login/approve/{challenge}. The app then finishes with its pending id, which the page never sees.webauthn.get, exact challenge, origin host ∈ the server's own hosts, rpIdHash, UP flag, signature over authData ‖ SHA-256(clientDataJSON), growing counter. Each has a negative test (server/src/webauthn.rs). Pure Rust (p256,ciborium); no OpenSSL.Clients
plaintext signin-key add NAME | ls | remove NAME | codes.signin,unlock, and Phase 1'skey addand renewal) touch the key when the account needs one.storage.session, memory only, because MV3 can stop the background while the tab is open. It holds the Account Unlock Key, never the login key, so it's as sensitive as the Account Key already kept there.storage.local.loginfails withKeyNeeded.pending_key_page()returns the page, andfinish_login(recovery)/cancel_login()finish or drop the sign-in.Tests
key addon a trusted computer, the recovery-code prompt, and removal.No real hardware key was used (Nikita's decision on the ticket); the CTAP path for sign-in (
Hid::register/assert) isn't exercised by tests.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.