Enforce alwaysUv on getAssertion - #291
Open
vaulttec-dev wants to merge 1 commit into
Open
vaulttec-dev wants to merge 1 commit into
vaulttec-dev wants to merge 1 commit into
Conversation
makeCredential rejects a request without user verification when the alwaysUv option is set, but getAssertion only validated pinUvAuthParam when the platform happened to send one. An authenticator advertising alwaysUv in getInfo would therefore ask for the PIN at registration and skip it on every later login. Apply the same condition and the same error as the makeCredential path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
authenticatorGetAssertionnever checks thealwaysUvoption.cbor_make_credential.cenforces it — a request without user verification isrejected with
CTAP2_ERR_PUAT_REQUIRED.cbor_get_assertion.chas no equivalent:it validates
pinUvAuthParamonly when the platform happens to send one, and thereis no path that requires it.
So an authenticator that reports
alwaysUv: trueingetInfoasks for the PIN atregistration and then silently skips it on every subsequent login. The option
promises user verification on every operation; assertions do not deliver it.
CTAP 2.1 §6.2 requires user verification when
alwaysUvis set.Reproduction
Against the host emulator, with
alwaysUvenabled and a PIN configured:Fix
Apply the same condition and the same error as the
makeCredentialpath, placedjust before the existing
pinUvAuthParamhandling.After the change, on the same emulator:
Normal login with a PIN is unaffected; discoverable credentials still resolve.
Notes
Found while shipping a downstream build that turns
alwaysUvon by default. Happyto adjust placement or wording if you would rather handle it elsewhere in the flow.