Skip to content

feat(webauthn): force UV=required when PRF extension is requested (fix #183)#213

Open
AlfioEmanueleFresta wants to merge 1 commit into
masterfrom
issue-183-prf-uv
Open

feat(webauthn): force UV=required when PRF extension is requested (fix #183)#213
AlfioEmanueleFresta wants to merge 1 commit into
masterfrom
issue-183-prf-uv

Conversation

@AlfioEmanueleFresta
Copy link
Copy Markdown
Member

@AlfioEmanueleFresta AlfioEmanueleFresta commented May 12, 2026

Closes #183. Implements the W3C direction in w3c/webauthn#2337: presence of the PRF extension on create() or get() transparently forces userVerification = "required" before the request reaches the authenticator. The CTAP2-level hmac-secret extension is unchanged.

Behaviour changes for callers

  • Discouraged / Preferred + PRF now triggers UV. On no-PIN devices this enters the interactive PIN-setup flow (PinNotSet).
  • U2F-only devices: PRF requests now error with NegotiationFailed instead of silently dropping PRF (U2F has no PRF).

Notes

  • Enforcement is at the public WebAuthn API entry (webauthn.rs), so both JSON-IDL and direct-struct callers are covered.
  • Unit tests cover the predicate truth table.
  • Integration tests cover registration upgrade, assertion upgrade (with a clear_uv_auth_token_store() to force fresh UV), and a negative case proving the upgrade does not fire without PRF.

…#183)

WebAuthn PRF outputs are sensitive key material. Per the spec direction
in w3c/webauthn#2337, callers requesting the PRF extension must have
userVerification upgraded to "required" before the request reaches the
authenticator. This applies regardless of whether PRF eval values are
populated -- presence of the extension is the trigger.

The upgrade happens at the public WebAuthn API entry (webauthn.rs), so
both JSON-IDL and direct-struct callers are covered. The CTAP2-level
hmac-secret extension keeps its existing separate UV / non-UV seed
behaviour and is not affected.

Notable behaviour changes for callers:
- Discouraged or Preferred + PRF now triggers UV (PIN setup if no PIN).
- U2F-only devices were already incapable of PRF; PRF-bearing requests
  now error with NegotiationFailed instead of silently dropping PRF.
@AlfioEmanueleFresta AlfioEmanueleFresta marked this pull request as ready for review May 12, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require UV for WebAuthn PRF requests

1 participant