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

backup states in authenticator data #1695

Merged
merged 9 commits into from
Jun 9, 2022
Merged

Conversation

timcappalli
Copy link
Member

@timcappalli timcappalli commented Feb 8, 2022

This PR adds backup state bits to authenticator data as described in #1692

WIP

fixes #1692
improves #1665


Preview | Diff

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
@timcappalli timcappalli changed the title #1692 backup states in authenticator data backup states in authenticator data issue#1692 Feb 8, 2022
@timcappalli timcappalli changed the title backup states in authenticator data issue#1692 backup states in authenticator data Feb 8, 2022
@nadalin nadalin added this to the L3-WD-01 milestone Feb 9, 2022
@timcappalli
Copy link
Member Author

timcappalli commented Feb 9, 2022

Call on 2022-02-09: TODO - Add validation process to section 7.2 (and also check 7.1 registration)

@MasterKale
Copy link
Contributor

@timcappalli Thank you for kicking off this effort to make use of these extra bits. We here at Duo (and the greater Cisco) are eager for the extra insight into passkey utilization as we continue to champion WebAuthn adoption for passwordless auth. Once passkeys launch it's just a matter of time before customers start asking us for greater control over the use of passkeys by their users. If we can have the data in these bits on Day 1 RPs like us can better adapt our product to respond to these requests, instilling confidence in our users that WebAuthn is the preferred way to achieve a more secure authentication experience.

index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
Copy link
Member

@emlun emlun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a mixed bag of editorial fixes, wordsmithing ideas and open questions... 🙂

index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Contributor

@equalsJeffH equalsJeffH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's some comments/suggestions building on @emlun's review... 😄

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Member

@emlun emlun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the edits and patience! Here's some more...

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@timcappalli timcappalli requested a review from agl April 11, 2022 15:37
index.bs Show resolved Hide resolved
@Kieun
Copy link
Member

Kieun commented Apr 26, 2022

The platforms might decide whether the new device is capable of restoring the backup credential? Is there any policy for this?
RP might want to enforce 2FA (with UV) and so it requires UV for the registration/authentication. If the generated credential is BE (backup eligible) and then restored from the new device, then still we can make sure that the credential is protected by UV? Or, is it possible that the credential is restored but the UP is only supported on the new device?

@Firstyear
Copy link
Contributor

The platforms might decide whether the new device is capable of restoring the backup credential? Is there any policy for this? RP might want to enforce 2FA (with UV) and so it requires UV for the registration/authentication. If the generated credential is BE (backup eligible) and then restored from the new device, then still we can make sure that the credential is protected by UV? Or, is it possible that the credential is restored but the UP is only supported on the new device?

Wouldn't this also imply a change in the attestation chain of the credential when it's restored since it's on a different piece of hardware that has different UV capabilities?

@emlun
Copy link
Member

emlun commented May 10, 2022

Wouldn't this also imply a change in the attestation chain of the credential when it's restored since it's on a different piece of hardware that has different UV capabilities?

I believe this question is what the devicePubKey extension is intended to answer - that the attestation for the backed-up key can be "weak", but the devicePubKey attestation on each device can give stronger guarantees about the device-bound key.

But it's a good point that we should probably include some guidance or disclaimers about how this interacts with UV. Presumably, a credential restored from backup onto a new authenticator would use whatever UV option(s) available on the new authenticator, unrelated to any UV configured on the original authenticator. So for example, if the original authenticator had a PIN configured, then after restoring the credential onto a new authenticator, the new authenticator may have a different PIN configured or no PIN at all.

Whether my presumption above is accurate or not, I think we should call out in the User Verification definition how credential backup is expected to interact with UV. This might relate to devicePubKey as well - for example, if an RP is keeping track of which credentials have sent UV=1 in the past, then the RP may want to track that per device public key for multi-device credentials (because UV=1 is meaningless the first time on a new device, but meaningful from the second time on).

@ve7jtb
Copy link
Contributor

ve7jtb commented May 10, 2022

In practice, the three platform authenticators only support credential release via UV if the RP requests it or not.

However, from a specification point of view, those are just current implementation choices.

Unless we say explicitly that multi-device credentials need to be protected with some form of user verification, then we need to remind RP that a credential might always be returned without UV even if it was created with UV. That is also the case now as the UV flag can be tampered with in the request.

Chrome and Windows will prompt a user to add a pin for roaming authenticators if you send UV required in the request.
One possibility is requiring authenticators to register a UV method if UV=required in the request and none is configured. Though that is typically an implementation detail and not in the spec.

@Kieun
Copy link
Member

Kieun commented May 10, 2022

At least, during registration process, RP has a way to specify their preference or policy for the authentication. But, if the restored credential has different properties, it will cause unexpected situation. So, my thought is that the backup credential needs to keep the basic properties from the original one.

webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this pull request May 12, 2022
https://bugs.webkit.org/show_bug.cgi?id=240353
rdar://problem/93191958

Reviewed by Brent Fulgham.

Source/WebCore:

Add flags for credential backup state: w3c/webauthn#1695

* Modules/webauthn/WebAuthenticationConstants.h:

Source/WebKit:

This patch adds support for backup state flags, which will be added to
the Web Authentication spec soon via w3c/webauthn#1695

These flags are set whenever a credential is "backup eligible" and "backed up"
hinting to RPs that the credential is "durable" and may persist through device
restores. This is useful for RPs that may choose to offer to remove the user
password if a credental is in this state.

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticatorInternal::authDataFlags):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):

Canonical link: https://commits.webkit.org/250501@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JonWBedard pushed a commit to WebKit/WebKit that referenced this pull request May 18, 2022
    [WebAuthn] Include backup state in authenticatorData
    https://bugs.webkit.org/show_bug.cgi?id=240353
    rdar://problem/93191958

    Reviewed by Brent Fulgham.

    Source/WebCore:

    Add flags for credential backup state: w3c/webauthn#1695

    * Modules/webauthn/WebAuthenticationConstants.h:

    Source/WebKit:

    This patch adds support for backup state flags, which will be added to
    the Web Authentication spec soon via w3c/webauthn#1695

    These flags are set whenever a credential is "backup eligible" and "backed up"
    hinting to RPs that the credential is "durable" and may persist through device
    restores. This is useful for RPs that may choose to offer to remove the user
    password if a credental is in this state.

    * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
    (WebKit::LocalAuthenticatorInternal::authDataFlags):
    (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserVerification):
    (WebKit::LocalAuthenticator::continueGetAssertionAfterUserVerification):

    Canonical link: https://commits.webkit.org/250501@main
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Canonical link: https://commits.webkit.org/250381.18@safari-7614.1.13-branch
git-svn-id: https://svn.webkit.org/repository/webkit/branches/safari-7614.1.13-branch@294134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@nadalin nadalin requested a review from MasterKale June 9, 2022 17:28
Copy link
Contributor

@ve7jtb ve7jtb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

index.bs Show resolved Hide resolved
Copy link
Contributor

@selfissued selfissued left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nicksteele nicksteele self-assigned this Jun 9, 2022
@agl
Copy link
Contributor

agl commented Jun 9, 2022

Agreed to merge at face-to-face meeting.

index.bs Show resolved Hide resolved
@nicksteele nicksteele merged commit b24eb36 into main Jun 9, 2022
@nicksteele nicksteele deleted the timcappalli-1692-backup branch June 9, 2022 17:36
github-actions bot added a commit that referenced this pull request Jun 9, 2022
SHA: b24eb36
Reason: push, by @nicksteele

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backup state of credentials