Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Webauthn support for excludeCredentials #1285

Closed
eparkko-lab opened this issue Jul 19, 2019 · 7 comments · Fixed by #1311
Closed

Webauthn support for excludeCredentials #1285

eparkko-lab opened this issue Jul 19, 2019 · 7 comments · Fixed by #1311

Comments

@eparkko-lab
Copy link

Description:

Brave on iOS does not seem to support Webauthn excludeCredentials. This will impact RelyingParties that wish to prevent a user from registering the same key multiple times.

Steps to Reproduce

  1. Using Brave on iOS go to https://webauthntest.azurewebsites.net/ and login
  2. Click button for Create Credential
  3. Change the default for RP Info to "This Domain"
  4. Select the box for "excludeCredentials"
  5. Make sure User Info "Bob" is selected.
  6. Click Create and tap the security key.
  7. The credential is created.
  8. Click button for Create Credential again.
  9. Assuming all the same values are still selected, click Create and tap the security key.

Actual result:
The credential is created 2 times for Bob.

Expected result:
The credential should not be created the second time. An error should be returned.

Something like this:
image

Reproduces how often: Easily reproduced

Brave Version:
1.1.0 (19.06.21.17)

Device details:
iPhone Xr (12.3.1)

Additional Information

@srirambv
Copy link
Contributor

@Brandon-T @jumde I am seeing the credentials getting created and no error as per test description. Could you verify if this is expected?
File (1)

@LaurenWags
Copy link
Member

LaurenWags commented Aug 13, 2019

Verified passed with iPad 5th Gen using 1.11.1 (19.08.12.19)

  • Verified STR from description
    IMG_0401

Verification PASSED on iPhone 6s+ iOS 12.4 using 1.11.1 (19.08.12.19)

IMG_9861

@kjozwiak
Copy link
Member

kjozwiak commented Aug 13, 2019

@eparkko-lab mind going through this again to see if it's working on your end with either 1.11.1 (19.08.12.19) or 1.11.1 (19.08.12.20)?

@eparkko-lab
Copy link
Author

@kjozwiak Could you invite [email protected] as an external tester in TestFlight to test these versions? I don't currently have access to those versions of Brave.

@jumde
Copy link
Contributor

jumde commented Aug 13, 2019

@eparkko-lab - We are working on it, will have an update for you in a bit. Thank you for filing these issues, super helpful.

@eparkko-lab
Copy link
Author

@jumde

Brave Version:
1.11.1 (19.08.13.17)

Device details:
iPhone Xr (12.3.1)

I noticed that if I set excludeCredentials and list a credentialId that is already created while creating another credential that a NotAllowedError is returned now.

In this same scenario, Chrome, Edge and FF all return an InvalidStateError. I didn't confirm with the spec which is the correct behavior.

Steps to reproduce:

Go to below site to submit webauthn request:
https://eparkko-lab.github.io/webauthn-playground/?requestType=create&webauthnRequest=eyJjaGFsbGVuZ2UiOiJhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicnAiOnsiaWQiOiJlcGFya2tvLWxhYi5naXRodWIuaW8iLCJuYW1lIjoiZXBhcmtrby1sYWIuZ2l0aHViLmlvIn0sImF1dGhlbnRpY2F0b3JTZWxlY3Rpb24iOnsidXNlclZlcmlmaWNhdGlvbiI6InByZWZlcnJlZCIsImF1dGhlbnRpY2F0b3JBdHRhY2htZW50IjoiY3Jvc3MtcGxhdGZvcm0ifSwidGltZW91dCI6MTUwMDAsImF0dGVzdGF0aW9uIjoiZGlyZWN0IiwicHViS2V5Q3JlZFBhcmFtcyI6W3sidHlwZSI6InB1YmxpYy1rZXkiLCJhbGciOi03fV0sInVzZXIiOnsiaWQiOiJiYmJiYmJiIiwibmFtZSI6IkJvYmJ5QGxvY2FsaG9zdCIsImRpc3BsYXlOYW1lIjoiYmJiYmJiYiJ9fQ%3D%3D&submitRequest=true

In same browser then submit another request which uses excludeCredentials:
https://eparkko-lab.github.io/webauthn-playground/?requestType=create&webauthnRequest=eyJjaGFsbGVuZ2UiOiJhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhIiwicnAiOnsiaWQiOiJlcGFya2tvLWxhYi5naXRodWIuaW8iLCJuYW1lIjoiZXBhcmtrby1sYWIuZ2l0aHViLmlvIn0sImF1dGhlbnRpY2F0b3JTZWxlY3Rpb24iOnsidXNlclZlcmlmaWNhdGlvbiI6InByZWZlcnJlZCIsImF1dGhlbnRpY2F0b3JBdHRhY2htZW50IjoiY3Jvc3MtcGxhdGZvcm0ifSwidGltZW91dCI6MTUwMDAsImF0dGVzdGF0aW9uIjoiZGlyZWN0IiwicHViS2V5Q3JlZFBhcmFtcyI6W3sidHlwZSI6InB1YmxpYy1rZXkiLCJhbGciOi03fV0sInVzZXIiOnsiaWQiOiJiYmJiYmJiIiwibmFtZSI6IkJvYmJ5QGxvY2FsaG9zdCIsImRpc3BsYXlOYW1lIjoiYmJiYmJiYiJ9LCJleGNsdWRlQ3JlZGVudGlhbHMiOlt7InR5cGUiOiJwdWJsaWMta2V5IiwiaWQiOiIke2xhc3RHZW5lcmF0ZWRJZH0ifV19&submitRequest=true

Notice the NotAllowedError returned by Brave vs InvalidStateError that is returned by other browsers. This could potentially have an impact on RPs.

@jumde
Copy link
Contributor

jumde commented Aug 20, 2019

The spec is not very clear about the error:

excludeCredentials, of type sequence<PublicKeyCredentialDescriptor>, defaulting to None
This member is intended for use by Relying Parties that wish to limit the creation of multiple credentials for the same account on a single authenticator. The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter.

Will update the error: #1413

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants