Repository navigation
feat: add 'collect-webauthn-pin' session event for security key PINs - #55426
adamant-pwn wants to merge 3 commits into
Conversation
Chromium's FIDO layer asks its embedder to collect a PIN through
FidoRequestHandlerBase::Observer::SupportsPIN()/CollectPIN(). Electron's
authenticator request delegate left those at the content-layer defaults
(no PIN support), so on platforms without a system WebAuthn UI — notably
Linux — a security key that requires user verification could never
complete a request: there was nowhere to ask for the PIN.
Implement the PIN observer hooks and bridge them to a new session event,
'collect-webauthn-pin', following the same pattern as
'select-webauthn-account':
- SupportsPIN() reports true only while a listener is registered for the
event, so PIN collection is strictly opt-in and existing apps keep
their current behavior (e.g. userVerification 'preferred' requests
continue to complete without UV rather than being routed into a PIN
exchange nothing can service).
- CollectPIN() emits the event with the relying party id, the reason
('challenge' | 'set' | 'change'), the error from a failed previous
attempt, the authenticator's minimum PIN length, and the remaining
attempts before hard lock. The listener answers through a callback;
calling it with no arguments cancels the request.
- Entries are validated locally with device::pin::ValidatePIN before
being sent to the authenticator, re-emitting the event with 'error'
set instead of consuming one of the limited retry attempts on a PIN
that cannot possibly be accepted — mirroring Chrome's PIN dialog.
- StartBioEnrollment() dismisses inline biometric enrollment
immediately (the equivalent of Chrome's "skip" button) so that
makeCredential on a biometric-capable but unenrolled key proceeds
instead of waiting on UI that will never appear.
Co-Authored-By: Claude Fable 5 <[email protected]>
… specs Chromium's AuthTokenRequester already validates every entered PIN (length, encoding, same as the current PIN) and asks again through CollectPIN() with the error set, so Electron no longer validates it a second time with its own rules. A callback from an earlier prompt in the same request is ignored, so a late answer to a superseded prompt cannot answer the current one. Specs on the simulated UV-locked security key cover a correct, wrong, too-short and cancelled PIN. The no-listener warning now names the event that enables PIN entry, and the docs describe `error` and `minPinLength` as Chromium reports them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@MarshallOfSound this picks up #53351, which you closed for unsigned commits and conflicts. The commits are now signed and rebased onto #54355. Could you approve the CI workflows when you have time? #55427 (hybrid transport) is stacked on this one. |
…45 (#1215) * feat(loxel): ship releases on a patched Electron 45 Releases now package Electron 45.3.0 with patches that add security key PIN entry and phone (FIDO hybrid) passkeys: electron/electron#55426 and #55427, plus a fix so the QR code is only offered when the request can use the phone. The patches live in packages/loxel/electron/patches/. scripts/build-electron.ts builds both architectures on a Mac and uploads them to R2 under an ID derived from the version and the patches; release-loxel.yml fetches the matching build and fails if it is missing. Moving to Electron 45 also: - moves the data encryption key to the async safeStorage API (the synchronous methods are deprecated in 45 and removed in 46); a keychain that withholds the key no longer leads to it being replaced - gives dev runs their own Electron data directory, so a dev app's browser panels don't lock the installed app's profile databases Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(loxel): show passkey QR codes for phone sign-in in browser panels Cross-device passkeys (FIDO hybrid transport): when a page in a browser panel asks for a passkey that a phone can provide, the patched Electron's 'webauthn-hybrid-request' session event hands Loxel a FIDO:/ QR code. The panel that made the request shows it over its page, so a background panel can't put one in front of the user, and hides it when the request ends. The code is a per-request secret: it goes only to the hosting window's renderer and is never logged. On stock Electron the listeners never fire. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(loxel): keep Dependabot from bumping the patched Electron A Dependabot electron bump would pass CI and then fail the release, which needs the patched build for the exact version uploaded first. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(loxel): harden the patched Electron pipeline and QR routing From review: - build-electron.ts: count a build as uploaded only when its checksum (written last) is there too; refuse a build config that points at another checkout; reuse a zip already built for the same ID so a --no-upload run only needs uploading; set the working directory per command; copy each zip to build/electron-dist with a build-ID marker. - release-loxel.yml: check both architectures are in R2 before the version bump, so a missing build leaves no release commit or tag. - build-app.ts: refuse a zip whose marker names another build. - webauthn.ts: a completion from a frame outside the panels, or from an older request of the same webview, no longer hides a live QR code; the webview's destroyed listener is removed when its request ends. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: describe signing in with a passkey from your phone Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(loxel): keep the patched Electron builds in the private CI bucket They are an input to the release, not a download, so they move from the public release bucket to loxel-ci-private, reached with the R2_PRIVATE_* token CI already has. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
A macOS data point, since the docs mention Linux: the same thing happens on macOS. In T3 Code's in-app browser (Electron 44.10.1, macOS security keys go through |
Description of Change
Supersedes #53351, which was closed for unsigned commits and conflicts. The first commit is @SeraVault's original change rebased onto #54355; the second relies on Chromium's own PIN validation and adds specs.
On Linux there is no system WebAuthn UI, so since #54355 a request that needs a security key PIN is cancelled. This blocks resident passkeys and any
userVerification: 'required'request on a PIN-protected key (#24573).This adds a
collect-webauthn-pinsession event, modelled onselect-webauthn-account. It reports the relying party, why the PIN is needed, the previous error, the minimum length and the remaining attempts. The listener answers with the PIN, or with nothing to cancel. Chromium validates each entry and fires the event again witherrorset. PIN collection is enabled only while a listener is registered, so other apps are unaffected.Tested on Linux with a PIN-protected YubiKey 5, including a wrong PIN and passkey sign-in on github.com.
AI assistance: both commits were written with Claude Code; I tested them on hardware.
Checklist
npm testpassesnpm teston Linux: 57 failures, all of which also fail on unmodifiedmainat 3dfc698 in the same environment; the new specs pass.Release Notes
Notes: Added the
collect-webauthn-pinsession event for security key PINs.