Skip to content

fix: don't hang WebAuthn requests on platform passkey failures - #52682

Merged
VerteDinde merged 4 commits into
electron:mainfrom
VerteDinde:webauthn-passkeys-error-paths
Aug 17, 2026
Merged

VerteDinde merged 4 commits into
electron:mainfrom
VerteDinde:webauthn-passkeys-error-paths

Conversation

@VerteDinde

@VerteDinde VerteDinde commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Follow-up to #51563.

The platform passkey authenticator reported its failures with statuses the FIDO request handlers ignore for its authenticator type, so an unparseable clientDataJSON, a cross-origin frame, an RP that doesn't accept ES256, or a malformed Apple response left navigator.credentials.create()/get() pending until the WebAuthn timeout, in the worst case after a passkey had already been minted. Dispatching a selected authenticator could also complete the request synchronously and destroy the delegate while the selection code still touched its members, and configureWebAuthn silently coerced non-boolean platformPasskeys values.

This reports terminal statuses instead (the page gets a prompt NotAllowedError), advertises ES256 via GetAlgorithms() so unsupported registrations are filtered before dispatch, consumes selection state before running dispatch callbacks, skips the passkeys discovery for cross-origin frames so other authenticators can still serve them, validates platformPasskeys strictly, and logs DevTools errors on the failure paths that previously gave no signal. Docs and specs are updated to match.

Checklist

Release Notes

Notes: Fixed WebAuthn platform passkey requests on macOS hanging until the request timeout when an operation failed, and a potential crash when selecting between Touch ID and platform passkeys.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 6, 2026
@VerteDinde
VerteDinde force-pushed the webauthn-passkeys-error-paths branch from a8d5079 to 1953b28 Compare August 6, 2026 23:26
@VerteDinde
VerteDinde marked this pull request as ready for review August 7, 2026 07:21
@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes no-backport labels Aug 7, 2026
The request handlers ignore kAuthenticatorResponseInvalid from a
kICloudKeychain-type authenticator, so every reject path left the page
pending until the WebAuthn timeout. Report a terminal status instead,
advertise ES256 via GetAlgorithms() so non-ES256 registrations are
pre-filtered rather than routed into the base GetTouch() no-op, and log
response-validation failures to the DevTools console.
…n routing

Running the request/cancel callbacks can complete the request
synchronously and destroy the delegate, so consume selection state
before running them (same pattern as OnAccountSelected), guard the
default dispatch against an already-consumed selection, and don't offer
the platform passkeys discovery to cross-origin frames Apple's API
cannot serve - other transports can still handle those requests.
Reject non-boolean values with a TypeError like the touchID options do
(gin's converter silently coerced them), treat null/undefined as not
set, and validate before applying so a throw leaves the existing
configuration untouched. Also reset the process-global flag between
spec suites.
@MarshallOfSound

Copy link
Copy Markdown
Member

Heads up: Windows CI builds moved to new runners on Monday and the old ones have now been removed. This branch predates that, so its Windows build jobs still point at the old runners and will sit queued forever if CI runs again. Rebasing on main (or "Update branch") picks up the change, nothing else needed.

@VerteDinde
VerteDinde merged commit 0efc6a8 into electron:main Aug 17, 2026
73 checks passed
@release-clerk

release-clerk Bot commented Aug 17, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed WebAuthn platform passkey requests on macOS hanging until the request timeout when an operation failed, and a potential crash when selecting between Touch ID and platform passkeys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

45-x-y no-backport semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants