Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webauthn): validate discoverable login with handle = nil #164

Closed

Conversation

Daedaluz
Copy link

@Daedaluz Daedaluz commented Sep 26, 2023

I ran into an issue while trying to use the credentials over the phone where the signed response does not contain a user handle.

Digging into this, I found https://w3c.github.io/webauthn/#user-handle

Discoverable credentials store this identifier and MUST return it as response.userHandle in authentication ceremonies started with an empty allowCredentials argument.

and

The main use of the user handle is to identify the user account in such authentication ceremonies, but the credential ID could be used instead.

I suppose this means that the user handle can be absent in case the ceremony is started with specific allowed credentials?

Seems like there has been some relvant discussions here and here

The implementation should then, at least

if len(session.AllowedCredentialIDs) > 0 {
    ...
}

Or perhaps save the intended user handle in session with the help of another LoginOption and in ValidateDiscoverableLogin just use the handle from the session (if present), as the whole issue seems to be about indexing?

In any case, to me, it looks like it's valid with a UserHandle == nil response.

To add, apparently, I could not use the phone to do login with no AllowedCredentials specified from some reason which i don't fully understand yet (Yubikey works fine though).

Edit:
The credentials for the RP just wasn't listed by default having AllowedCredentials = nil. There was another button more options -> this device that listed the usable credentials.

* Allow nil user handle
@Daedaluz Daedaluz requested a review from a team as a code owner September 26, 2023 10:38
@Daedaluz Daedaluz marked this pull request as draft September 26, 2023 17:41
@Daedaluz Daedaluz changed the title ValidateDiscoverableLogin fix fix(webauthn): validate discoverable login with handle = nil Sep 27, 2023
@Daedaluz Daedaluz closed this Oct 18, 2023
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.

None yet

1 participant