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

No way to verify requireResidentKey during registration step at RP side #1060

Closed
Kieun opened this issue Sep 10, 2018 · 21 comments
Closed

No way to verify requireResidentKey during registration step at RP side #1060

Kieun opened this issue Sep 10, 2018 · 21 comments

Comments

@Kieun
Copy link
Member

Kieun commented Sep 10, 2018

In order to allow authenticators having require resident key feature only due to security reasons, RP can set requireResidentKey as true when calling create request.

dictionary AuthenticatorSelectionCriteria {
    AuthenticatorAttachment      authenticatorAttachment;
    boolean                      requireResidentKey = false;
    UserVerificationRequirement  userVerification = "preferred";
};

Even platforms and browsers handle such parameters and may work correctly, from the view point of RP side, there is no way to verify whether credentials are really resident at authenticator side or not.
If the authenticator data includes requireResidentKey as a flag like UV and UP, RP can verify its value and integrity by verifying the signature.

@emlun
Copy link
Member

emlun commented Sep 10, 2018

I was about to say this can in theory be derived from trust in the attestation statement and thus trust that the authenticator obeys the parameter - but since requireResidentKey is actually not included in CollectedClientData, it is indeed not possible for the RP to verify that the option was respected (other than performing a successful authentication ceremony with no allowCredentials).

This issue is related to #889 and #991.

@Kieun
Copy link
Member Author

Kieun commented Sep 10, 2018

I think we may use RFU bit of flags in authenticator data without breaking changes for requireResidentKey state.

@emlun
Copy link
Member

emlun commented Sep 10, 2018

It would be a breaking change for authenticator vendors, who would have to implement that flag.

@Kieun
Copy link
Member Author

Kieun commented Sep 10, 2018

@emlun yeah, you are right. I have just considered RP side.

@nadalin nadalin added this to the L2-WD-00 milestone Sep 11, 2018
@herrjemand
Copy link
Contributor

@Kieun Is there a reason why RP needs to know if it RK? The client will anyway reject if Authr does not support RK

@emlun
Copy link
Member

emlun commented Jan 16, 2019

@herrjemand the requireResidentKey parameter is not signed over, so it's not possible for the RP to verify that the client passed the intended value through to the authenticator. But it's probably not a huge deal since a malicious client could do way worse things anyway.

@Kieun
Copy link
Member Author

Kieun commented Jan 16, 2019

@herrjemand I'm not sure about the current authenticator's implementation. But, what if the authenticator only supports device resident key feature and the server set requireResidentKey as false or let it as default value?
With current approach, there is no way for RP to check whether the credential is located in the client side or not. Also, such information should be singed over to provide the integrity.

@herrjemand
Copy link
Contributor

@Kieun FIDO2 authenticator can not be RK only. RK is an optional feature. The core MakeCred and GetAssertion are mandatory. Additionally for RP there is no difference to have RK cred returned or not RK cred returned. For RK it is the same assertion.

@Kieun
Copy link
Member Author

Kieun commented Jan 16, 2019

@herrjemand Without the authenticator support resident key, RP cannot provide username-less UX flow. So, from the RP perspective, RP should have that kind information.
Regarding the optional feature, would you point out it? I could find the spec says the requireResidentKey and rk is optional parameters for the operation and not for the authenticator type.
I think almost of platform authenticators only support client side residential key.

@herrjemand
Copy link
Contributor

@Kieun RP can get this information by calling MakeCred with RK and see if the call fails or succeeds.

@herrjemand
Copy link
Contributor

@herrjemand
Copy link
Contributor

I think issue #991 would be something good for you to look

@Kieun
Copy link
Member Author

Kieun commented Jan 17, 2019

@herrjemand Thanks for pointing out the related docs.
When I tried to test requrieResident key feature with Edge and Windows Hello (PIN), I can create the key with default value (false) and the generated key can be used in username-less flow (empty allowCredentials).
So, I am thinking that browsers do not filter out the authenticator that only supports RK when requireResidentKey is false and the authenticator maintains the credential in the client side.
So, for supporting this, RP should set requireResidentKey is true for the creation and handle error than try with requireResidenKey as false. This is very bad UX for the user and it is hard to handle.
If RP wants support various scenarios (username-less, first-factor, second-factor and etc) depending on the authenticator types, it is better for RP to get the authenticator types (rk, uv, up and etc) during the registration process.

@emlun
Copy link
Member

emlun commented Jan 17, 2019

requireResidentKey: false does not mean the authenticator must not create a resident key. It only means that a resident key is not required, so the authenticator is free to choose which kind of key to create.

@emlun
Copy link
Member

emlun commented Jan 17, 2019

FIDO authenticators may be required to support non-resident credentials, but I don't think the abstract authenticator model in WebAuthn forbids authenticators that only support resident keys.

@herrjemand
Copy link
Contributor

Yes, @emlun is correct about it.

@Kieun
Copy link
Member Author

Kieun commented Jan 18, 2019

So, my suggestion is that RP should have knowledge whether the key is resided in the client side or not during the registration process without trial and error. Such information should be delivered to the RP server so that RP can decide UX flow for the authentication.

@equalsJeffH
Copy link
Contributor

@emlun wrote:

requireResidentKey: false does not mean the authenticator must not create a resident key. It only means that a resident key is not required, so the authenticator is free to choose which kind of key to create.

Agreed, that is my understanding per webauthn & CTAP specs.

note that the werbauthn language for requireResidentKey says only this:

"If the parameter is set to true, the authenticator MUST create a client-side-resident public key credential source when creating a public key credential."

Note also the "credential storage modality" section here: http://w3c.github.io/webauthn/#sctn-credential-storage-modality, ..whose last paragraph says:

Note that a resident credential capable authenticator MAY support both storage strategies. In this case, the authenticator MAY at its discretion use different storage strategies for different credentials, though subject to the requireResidentKey option of create().

It seems to me @Kieun has a valid point here (#1060 (comment))

cc: @christiaanbrand

@sbweeden
Copy link
Contributor

sbweeden commented Feb 5, 2019

To me this original requirement seems well aligned with issue #991

@equalsJeffH equalsJeffH self-assigned this Feb 6, 2019
@emlun
Copy link
Member

emlun commented Apr 24, 2019

Handled by PR #1191

@equalsJeffH
Copy link
Contributor

#1191 was merged, closing this...

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

No branches or pull requests

6 participants