[webauthn] Add device binding to cross-device fallback URL extension (#2478)

iinuwa has just created a new issue for https://github.com/w3c/webauthn:

== Add device binding to cross-device fallback URL extension ==
## Description

The fallback URL extension in #2341 adds the ability for an RP. Supposedly, the RP include some sort of continuation, which is a perfect vector for session fixation attacks, such that if a victim authenticates uses their credentials after following an attacker's fallback URL, then they will be giving away the session to the victim.

If we assume an authenticated channel between the laptop and phone[^1], if there is a way to convey to the RP that the user consented to transfer the session from the phone to the laptop during a hybrid WebAuthn ceremony, then the RP could restrict the fallback URL's continuation to be completed by whoever can provide proof of that consent.

We can't really do anything cryptographically here without being to invasive into both the web and hybrid authenticator platforms, but I think that we can use modern web CSRF protections to allow the RP to be convinced that a value was received over a hybrid flow.

I think it would be important to get this out before the extension spec is finalized in L4 so that RPs can know that all implementing devices support the value.

## Definitions

- _Client A_: The client that initiates the WebAuthn request that will receive credentials. E.g. the user's (or the attacker's) laptop.
- _Client B_: The client that invokes the hybrid ceremony and authenticates via the fallback URL. E.g. the user's phone.
- session code verifier: A secret generated by Client B that will be presented to the RP to provide proof of possession.
- session code challenge: A value generated by Client B corresponding to the session code verifier, to be passed to Client A, which will forward to the RP.
- _hybrid client platforms_: platforms that are capable of receiving credentials over hybrid, includes both desktop (Windows/macOS/Linux), certain browsers (Chromium-based) and mobile (Android/iOS) platforms.
- _hybrid authenticator platforms_: platforms that are capable of sending credentials over hybrid, including Android and iOS.
- _WebAuthn continuation header_: a header that is passed by the hybrid authenticator platform containing the session code verifier.

## Proposal

### Client B's platform

When Client B, the hybrid authenticator:
  - supports the fallback URL extension, and
  - realizes it doesn't have credentials for the RP, and
  - the RP has provided a fallback URL:

1. Generate a session code verifier and challenge[^2]. 
  - This should probably be some sort of combination of a secret, fallback URL and WebAuthn challenge from, e.g. `sessionCodeChallenge = HMAC(sessionCodeVerifier, Canonicalize(fallbackUrl, clientDataHash))`
  - HMAC here does not provide any extra. We assume that Client A is nearby and trusted by the user
3. Return the session code challenge to Client A.
  - Since CTAP/PXP errors can't contain values, we may need to split this in two parts: send the session code challenge via a PXP update message, and then error with CTAP's "fallback invoked" error
4. Perform `GET <fallbackUrl>` with the user's default browser cookie jar, but with custom headers:
  - `Sec-Fetch-Site: none`: proves to the website that the URL was navigated to directly, not via Fetch or a cross-origin navigation
  - `WebAuthn-Continuation: <sessionCodeVerifier>`: proves possession of the secret related to the challenge that the RP should have received.[^3]
 

At this point, the RP's UI should take over to authenticate the user, which should take into consideration various trust signals, notify the user of the context, etc.

### Client A's platform
During a WebAuthn ceremony, if the hybrid transport is invoked by Client B:

1. Await a PXP update message corresponding to the fallback session message.
2. Extract the session code challenge from the update message.
3. If client B returns `CTAP2_ERR_CROSS_DEVICE_FALLBACK`, then return the error code and session code challenge to the Client, who should return this to the RP as a `WebAuthnOperationException`, along with `clientDataJSON`.

### RP

When invoking `navigator.credentials.get()` with a fallback URL specified:

1. Create and store a `continuation`, with mutable state:[^4]
   - `webauthnChallenge`: the challenge generated for the WebAuthn ceremony
   - `sessionCodeChallenge`: the code challenge to be received from Client A, initially set to `null`.
   - `sessionCodeChallengeMethod`: method to later verify code challenge with code verifier, initially set to `null`.
2. Create a `fallbackUrl` bound to the `continuation` state.
3. If `WebAuthnOperationException` is received with `.code == 'cross-device-fallback'`, then read `sessionCodeChallenge` and `sessionCodeChallengeMethod` from the exception, and store it in `continuation`.
4. Wait for a message from another session to the fallback URL.
5. Upon receiving the fallback URL[^5]:
  1. Verify that `Sec-Fetch-Site` header is set to `none`:
     - This proves that this is an direct browser navigation, not an attacker-owned phishing page.
     - This does not fully protect against phishing, clicking links or entering manually into browser location also sets this.
  2. let `sessionCodeVerifier` be the value of `WebAuthn-Continuation` header
     - Making this a header means that it cannot be simply clicked or entered into a browser location bar.
  3. read `continuation.sessionCodeChallenge`, and apply  `Verify(sessionCodeChallengeMethod, sessionCodeChallenge, sessionCodeVerifier)`
6. If the verification methods above succeeds, then show the UI to transfer the session to Client A.
 
## Attack Scenarios

### Click-through attack
1. Attacker owns Client A, goes through the ceremony and receives a fallback URL.
2. Attacker sends fallback URL to Victim via QR code, email, chat, link, etc.
3. Victim's device loads the fallback URL.
4. RP checks that `WebAuthn-Continuation` header is not set, so this is blocked.

### Attacker-hosted page

1. Attacker owns Client A, goes through the ceremony and receives a fallback URL, generates a `sessionCodeChallenge`/`sessionCodeVerifier` pair.
2. Attacker sends `sessionCodeChallenge` to RP to bind to `sessionCodeVerifier`.
3. Attacker sends Victim to attacker-owned page, which uses JavaScript to send a GET to the fallback URL with the `WebAuthn-Continuation` header set to `sessionCodeVerifier`
4. Victim's browser executes the GET via fetch.
5. RP checks that `Sec-Fetch-Site` header is not `none`, so this is blocked.

### Not covered

- proximate phishing
- malicious hybrid client: a malicious smart TV or kiosk displays a hybrid QR code to initiate hybrid for an attacker-controlled fallback URL.

These are both within within hybrid's threat model: the initiating device must be proximate and trusted. If trust is misplaced, or the user's proximity is compromised, then this proposal inherits the same threat model that exists for hybrid.

Besides that, the RP needs to implements suggestions from RFC 10027 to help provide proper context beyond binding the fallback URL to the device.
 
## Requirements by Role

- Browsers/Clients: Pass on session code challenge in the `WebAuthnOperationException` received from the hybrid ceremony (either via internal or platform APIs)- RPs: None required. RPs are free to check the headers sent on the fallback URL request and the session-binding value in the error, but they could ignore the protections and just use the fallback URL as the original issue intended. If they do want to use it though, they must:
  - store the session code challenge received from Client A, and
  - verify the session code verifier in the WebAuthn continuation and the `Sec-Fetch-Site: none` header when Client B loads the fallback URL.
  - They should also follow the recommendations in RFC 10027. 
- Hybrid client platforms: Receive the session code challenge (e.g. via PXP update message) for hybrid transport, and return it to the WebAuthn client.

- Hybrid authenticator platforms:
  - Send the session code challenge (e.g. via PXP update message)
  - Present consent screen to user (already required for fallbackUrl extension)
  - Open fallback URL in a web view with the default browser cookies, but containing the special WebAuthn continuation header and `Sec-Fetch-Site: none` header.

## Spec Prerequisites

- CTAP + PXP: alignment on returning the session-binding challenge to Client A.
- WebAuthn: Allow setting the `clientDataJSON` and `sessionCodeChallenge` values along with the `cross-device-fallback` code in `WebAuthnOperationException`


## Related Links
[^1]: I'm using laptop and phone as a stand-in for the client that receives credentials and one that sends them. Technically, Android and iOS are able to serve in both roles.
[^2]: I'm borrowing PKCE terminology, but PKCE only supports SHA256, which has become problematic. Maybe we need to specify an extension to PKCE, or just avoid referencing PKCE so we don't need to do that work. Crypto-agility should be included in whatever we decide on.
[^3]: An argument could be made to make this a `Sec-` header too, e.g. `Sec-WebAuthn-Continuation`, so that webpages can definitely not set this.
[^4]: non-normative, these interactions with Client A should be bound to Client A's unauthenticated session and any other trust signals.
[^5]: `sessionCodeChallenge` and `sessionCodeVerifier` can be received in either order, so RPs should be aware of that

Please view or discuss this issue at https://github.com/w3c/webauthn/issues/2478 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 8 September 2026 18:58:01 UTC