Skip to content

Enforce alwaysUv on getAssertion - #291

Open
vaulttec-dev wants to merge 1 commit into
polhenarejos:mainfrom
vaulttec-dev:fix/enforce-alwaysuv-on-getassertion
Open

vaulttec-dev wants to merge 1 commit into
polhenarejos:mainfrom
vaulttec-dev:fix/enforce-alwaysuv-on-getassertion

Conversation

@vaulttec-dev

Copy link
Copy Markdown

Problem

authenticatorGetAssertion never checks the alwaysUv option.

cbor_make_credential.c enforces it — a request without user verification is
rejected with CTAP2_ERR_PUAT_REQUIRED. cbor_get_assertion.c has no equivalent:
it validates pinUvAuthParam only when the platform happens to send one, and there
is no path that requires it.

So an authenticator that reports alwaysUv: true in getInfo asks for the PIN at
registration 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 alwaysUv is set.

Reproduction

Against the host emulator, with alwaysUv enabled and a PIN configured:

makeCredential without pinUvAuthParam  ->  PUAT_REQUIRED   (correct)
getAssertion   without pinUvAuthParam  ->  assertion returned, uv flag clear

Fix

Apply the same condition and the same error as the makeCredential path, placed
just before the existing pinUvAuthParam handling.

After the change, on the same emulator:

getAssertion without pinUvAuthParam  ->  PUAT_REQUIRED
getAssertion with    pinUvAuthParam  ->  assertion returned, uv flag set

Normal login with a PIN is unaffected; discoverable credentials still resolve.

Notes

Found while shipping a downstream build that turns alwaysUv on by default. Happy
to adjust placement or wording if you would rather handle it elsewhere in the flow.

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.
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.

1 participant