-
Notifications
You must be signed in to change notification settings - Fork 172
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
Device-bound key extension #1658
Comments
So if I understand this correctly, a
I feel like the custom signing procedure might be a bit too confusing, being almost the same as usual but not quite. It looks like this is going to require custom verification logic either way, so maybe we can move the difference around a bit? For example, here's one idea: Instead of modifying the signing procedure arguments, run the signing procedure as usual and store the resulting attestation object and client data. In subsequent re-runs, send all of it back to the RP. So it might instead look something like this:
Of course, this only moves the complexity slightly, but to me it seems a bit cleaner that the existing attestation signing and verification procedures can be used as-is as a larger unmodified "block". Composition instead of polymorphism, I guess. |
Unrelated to my previous comment: I can't really see what's the benefit of the new device key. It is authorized on first use by a signature chain from an already-registered, synced, key, right? So if the desire is to only rely on device-bound keys, it seems like that promise is already broken by the time the new device-bound key is registered. And since the synced key is by definition already synced, I can't see the device-bound key adding any redundancy if there's already a synced key that the RP accepts. I must be missing what the purpose of the device-bound key is. |
@emlun the device key is more of a signal to the RP. For example, some RPs may require another factor when a synced key is used for the first time from a device and/or application. Without the device key, there is no signal and the user may be prompted for a second factor every time (a similar experience as all cookies being blocked or cleared on browser restart). |
But isn't that additional factor (the device-bound key) dependent on the initial factor (the synced key)? The RP cannot begin to trust the device-bound key without already trusting the synced key, can it? So how is the device-bound key useful as an additional factor? |
@emlun, correct. The goal is to have a hardware bound "signal" that the synced key is being asserted from a new device/context. An RP may or may not take different actions depending on the device key. |
To give an example: Modern sign-in systems are risk-analysis systems that ingest a lot of signals before deciding whether to allow a sign-in. (And, usually, continue to collect risk signals even after allowing a sign-in and have the ability to revise their opinion.) Say that a sign-in request appears with a geolocation that has not been seen for this account before, and is outside of the typical working hours observed for the account. The risk may be deemed high enough not to allow the request, even with a synced credential. But if a device-bound signature can also be presented and it's a device-bound key that is well established for this user, then that may tip the balance. |
In reply to @emlun's technical comment above (thanks for your thoughts!)...
yes, I think so (without having grovelled thru specs).
It is different and for very specific reasons. The The re-formulation above does not accomplish this, because (at least) it seems it is anticipating that there was a registration operation involving the new device for that cred, given that it is suggesting that there is an "... attestation object for the ceremony when dpk was created". There might have been, in the case where the user is registering this device-cum-authnr for the first time with a given RP account, and/or there is no cred syncing. Note that this device public key feature is arguably not terribly useful in a world where there is no cred syncing. See also #1658 (comment) (above) for a use case example of how an RP could weave the DPK signal into their risk analysis. |
@timcappalli @agl Ah, I see, thanks for explaining. So what I missed is that @equalsJeffH I wasn't actually thinking that a But on that note, I suppose one complication with my suggestion is that |
A nitpick observation wrt:
...I'm inclined to declare
...(I'm also inclined to rename it, say, "cntx"). Though, one could also argue that "scope" better reflects the connotations here:
|
@equalsJeffH, there may be situations in the future where it is important to differentiate between I do think we should discuss |
@equalsJeffH , I would say that it gives flexibility in the future instead of mission creep. :) |
I think
I'll agree that "scope" seems like a slightly better name (especially since it's already described as such in the top post 😄). |
Yes, I suspected such thoughts were lurking about --- I begged the question so we could explicitly discuss them, rather than it be a fait-accompli. We already note that the scope is either entire-device "...or a loosely-defined, smaller scope called 'app'." I wonder whether having more fine-grained distinctions than "entire-device" vs "app" will be actually useful in the long run given that some question the usefulness of the per-"app" notion. But if we do decide to allow for such "flexibility in the future", I'd define scope as single-byte
Note: the above incorporates @emlun's suggestion of using "scp" as a contraction for "scope". Also, there's probably a way in CDDL to both explicitly constrain |
"scope" has expected meaning and semantics in a JWT context from usage as OAuth Access tokens. |
Sure, and that's particular to OAuth Access tokens. That does not mean some other object, such as a |
There are three points of confusion I have with this proposal:
|
Broadly, people talking about the spelling of that term in another related context with a completely different meaning is a bit of a flag that it might be the wrong term. That doesn't mean it might be the most descriptive English word to describe app vs device and therefore be appropriate to use despite potential confusion. So far I don't fully understand the purpose of that feature, so I can't really contribute to that discussion. |
@dwaite regarding # 3: today, when a platform authenticator is registered as a "trusted device" for step up or subsequent sign ins, it is ultimately a trusted app/browser, not trusted device. This leads to poor experiences and user confusion that we see today across browsers and apps. A platform that uses device-scoped DPKs can offer a better user experience across apps using the same RP. Example: I start my interactions with github.com in the browser A by authenticating with a passkey. The RP does not recognize this DPK and requires a step up / second factor. Now I use the GitHub app and present my passkey again. Since the RP sees the same DPK again, no step up / second factor is required. I then open browser B and authenticate to github.com with my passkey and again I'm not required to step up as the RP recognizes the DPK. Platforms may provide users the ability to reset the device key as part of their credential management UI. Some platform vendors do not believe the DPK should be shared between apps/contexts. This resulted in the compromise proposed as part of this issue where the platform can signal what the DPK represents. I should also note that RPs who do not require a hardware bound device key, do not need to request a DPK. I imagine that some platforms will not mint new DPKs until they are requested by an RP. |
Correct me if I misunderstand: the public key credential is scoped across physical authenticator devices to a particular (because it is “synched”. For these vendors, they want the physical-authenticator-bound key to both be restricted to a particular physical authenticator and to a specific software agent authorized to act on behalf of that origin? (A so-called “app”, but also presumably each of the various web browser user agents) What is not clear to me is for various definitions of context (device, application team/group, specific application id, installation-specific identity, CTAP-extension to capture remote client identity, whatever) what the RP is meant to do with merely a label that a particular type of context is in force. It seems like any information provided to aid a risk analysis process would be provided by the attestation itself, and likely would be vendor specific.
I hope the vast majority of RPs don’t even care about attestation, let alone differentiating contexts of use. |
Please forgive me if this is a dumb question or I'm missing a security property here. Can the device private key sign over just I assume I'm missing something here that I can learn from. Can someone help me understand? Thank you! 😁 |
Signing over userCredentialId prudently yields a cryptographic binding to the user credential, strongly demonstrating the device private key had access to the userCredentialId. When verified by a RP, it will help prevent the RP being possibly snookered by, say, some form of malware-induced substitution attack (although I do not have such a worked-out attack scenario at this time). Do you anticipate or find it an implementation hardship for the device private key to sign over both clientDataHash and userCredentialId ? |
Great question I should have anticipated and led with! No, there's no implementation difficulty. I was simply doing an exercise for my own education to whittle things away from this proposal and see how things break. I was also trying to come up with the RP-gets-snookered attack scenario and wasn't sure I could make it break; though as you said, signing over the Thank you for taking the time to think about this and respond! |
This is a lot of extra energy/effort to verify if a credential is multi-device - some RP's may want the stronger signature checking of validation that the sync credential was signed off in the sync process, but many RP's would benefit from a simple credProps boolean flag for "multi-device: true" which is a simpler signal for them to understand. Can the proposal be extended with this as well? |
The point of this extension is not to signal that a credential is multi-device, it's to "extend" a multi-device credential with one or more hardware-bound keys that don't migrate to other devices along with the multi-device key. So when the RP sees one of those hardware-bound keys for the second and subsequent time, that's a stronger assurance of authenticity than just the multi-device key. |
What is the process for the adoption of this proposal? |
In #1637 I wrote:
This is a proposal for that extension. This issue superceeds #1546 and so I'll close that in favour of this. This is mostly about the mechanism, but #1640 discusses some policy questions around this.
Note: This is the initial draft design. See PR #1663 for the in-progress up-to-date design.
To use this extension (
devicePubKey
) an RP simply includes it (with the valuetrue
) on all create() and get() calls for their users. If the user employs a new-to-the-RP device for an authentication operation using a synced user credential (issue #1665), a new-to-the-RP device public key is returned, signaling the use of the new device.Per the WebAuthn spec, if the devicePubKey extension is not supported by an authenticator, the extension is ignored, and no extension output is returned.
For both registration and authentication the underlying extension behavior is:
packed
,tpm
,android-key
,android-safetynet
, andapple
.)This extension output will itself be signed over in an "encompassing" attestation or assertion signature because extension outputs are an authenticator data component. Also, this extension may be returned as a result of a get() on a device where no create() has been done, due to credential syncing.
This design does not assign a "credential ID" to device keys because they are mapped to user credentials and we have the device private key sign over the client data hash and the user credential ID in order to "bind" to the current request and the user credential.
The device bound key pair is always of the same type (i.e., algorithm) as the user credential it is associated with.
We considered including a random authenticator-generated nonce in the data signed over by the device private key; the nominal notion being to randomize the signed-over data for side-channel protection. However, since this isn't done in CTAP so far, we have omitted it.
Consistently returning the same device public key attestation object — AttObjForDevicePublicKey — on both registration and authentication operations simplifies the design and accommodates the case where a user credential was synced to a new device where there was no prior registration operation, requiring the creation and return of a new-to-the-RP device public key. Since this extension output is simultaneously serving as both a registration and a proof-of-possession of the device private key, it includes a signature by the device private key (as mentioned above).
The attestation statement signs over the AAGUID and device public-key values, i.e., without including clientDataHash. The rationale for not including clientDataHash is that this AttObjForDevicePublicKey.attStmt ought to be able to be calculated by the authenticator once (e.g., upon the user credential being synced to a new device), locally cached, and subsequently returned upon demand. Since CollectedClientData changes per-request, signing over it would make that impossible.
Thus an RP would only have to perform thorough validation of the device public key pair's attestation statement (using the aaguid and dpk values as inputs) once, and cache them along with the attestation statement. Then for subsequent .get() responses the RP is able to just do byte-level comparisons to verify that they are among the set of cached values. If not, then the RP is talking to a "new" device.
The devicePubKey extension may be supported by any platform authenticator or roaming authenticator having the resources necessary to support it. Restricting this extension to only platform authenticators seems infeasible because the latter's definition is context dependent (see: phone-as-a-SK), and RPs may have various reasons, e.g., enterprise ones, for creating device key pairs on whatever authenticator form factor they encounter that is capable of supporting this extension.
(Thanks to @equalsJeffH, who actually wrote this proposal.)
The text was updated successfully, but these errors were encountered: