Skip to content

Fix UV-skipping logic with required and preferred - #374

Open
micolous wants to merge 3 commits into
mozilla:ctap2-2021from
micolous:ctap2/issue-373
Open

Fix UV-skipping logic with required and preferred#374
micolous wants to merge 3 commits into
mozilla:ctap2-2021from
micolous:ctap2/issue-373

Conversation

@micolous

Copy link
Copy Markdown
Collaborator

Fixes #373, matching the behaviour defined in the CTAP and WebAuthn specs:

  • Don't skip UV when uv = required.

    Previously, UV would be skipped when a device did not have some form of UV configured, and required the RPs to reject the request (which they need to do anyway for security reasons).

  • Don't skip UV when uv = preferred and an authenticator supports any form of user verification.

    Previously, this would be skipped when a device did not have some form of UV configured.

    UV is still skipped for authenticators that don't support any form of user verification (CTAP 1, and some CTAP 2.0 devices). Supporting UV is mandatory in CTAP 2.1 and later, but this doesn't enforce those rules.

    Unfortunately, this change will cause an authenticator that supports UV but is unconfigured to now fail those operations in Firefox, because it doesn't prompt to set PINs at enrolment time. These would previously proceed without UV.

  • Refactor the can_skip_user_verification checks to make them closer to CTAP 2.3's validation steps.

  • Update docs for AuthenticatorOptions::user_verification to use CTAP 2.3's wording, noting caveats with CTAP 2.0 and reformat it to look nicer in rustdoc.

Testing

I tested this with the ctap2.rs example. All changes in bold marked with ⭐. Any authenticator options not specified are missing.

Authenticator MC required MC preferred MC discouraged GA required GA preferred GA discouraged
CTAP 2.1, clientPin, alwaysUv, !makeCredUvNotRqd required required required required required required
CTAP 2.1, clientPin, !alwaysUv, makeCredUvNotRqd required required no UV required required no UV
CTAP 2.1, !clientPin, !alwaysUv,makeCredUvNotRqd fails fails no UV fails fails no UV
CTAP 2.1-PRE, clientPin required required required required required no UV
CTAP 2.1-PRE, !clientPin fails fails no UV fails fails no UV
CTAP 2.0, clientPin required required required required required no UV
CTAP 2.0, !clientPin fails fails no UV fails fails no UV
CTAP 1/U2F fails no UV no UV fails no UV no UV

* Update `AuthenticatorOptions::user_verification` docs to use the CTAP
  2.3 description, and note some caveats.

* Add `AuthenticatorOptions::supports_uv()` helper.
* Don't skip UV when `uv = required`

* Don't skip UV when `uv != discouraged` and UV is "possible" but
  unconfigured

This is rewritten to be closer to the CTAP 2.3 spec's steps.
@micolous

Copy link
Copy Markdown
Collaborator Author

CI failure looks unrelated, opened #375 for that.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requests with uv = required and uv = preferred are sent to CTAP2 devices with unconfigured user verification

1 participant