-
Notifications
You must be signed in to change notification settings - Fork 43
Add Feature Policy support for WebAuthn #138
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
Add Feature Policy support for WebAuthn #138
Conversation
|
I don't understand why this approach is right. I would have expected a feature policy to disable/enable the feature generally, not control whether the feature believes itself to be same-origin with its ancestors. Can you help me understand how you chose this mechanism? |
|
HI @mikewest, thanks for taking a look at this!
yes, we may not wish to conflate those two things. Basically, a feature policy can be defined that disables/enables a feature generally, even in cross-origin situations. So I took a stab at it this way first because it obviates adding a parameter (to convey the result of feature policy evaluation) to the credman internal methods, and I naively thought that "hey, maybe if the 'allowed to use' alg returns So, yeah, it may be that even though an embedder feels its ok for the embeddee to use a given credential internal method for a given credential type, maybe the embeddee will not agree and so providing the explicit background details wrt FP's cross-origin-ness: Yes, the cross-origin aspects of Feature Policy (FP) are a tad mind-bending-sorta-unexpected, however, it appears that FP does have implicit cross-origin permission properties according to @clelland, as explained in this recent relevant discussion on the public-webappsec@ list ("characterizing framing security needs for webappsec consideration"). Note his opening statement..
..and also that PaymentRequest's detault allowlist is Thus, given @clelland's explanation, along with how HTML's "allowed to use" alg calls FP's is feature enabled in document for origin alg, the use case of an embedder selectively enabling cross-origin feature use is enabled, e.g. see FP's Example 4. |
|
Hi @mikewest -- this is ready to re-review. Some notes to get you primed:
|
mikewest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a few nits. Sorry this took forever.
| Issue: do we need to in this algo get the [=set=] of | ||
| |options|' <a>relevant credential interface objects</a> and ensure the latter as well | ||
| as |options| contain only 1 item/member referring to the same credential type, as is | ||
| done in steps 5, 6, 7 of [[#algorithm-create]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we do, because we explicitly wanted to support picking one of several kinds of credentials. We haven't actually done that yet, and maybe it turns out not to make sense to do so, but for the moment, I'd leave this out.
| 6. Let |sameOriginWithAncestors| be `true` if |settings| is [=same-origin with its | ||
| ancestors=], and `false` otherwise. | ||
| 6. Let |sameOriginWithAncestors| be `true` if |settings| is [=same-origin with | ||
| its ancestors=], and `false` otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is webauthn just going to ignore this flag, and rely on FP to block access to requests instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webauthn uses this flag for a couple of things:
- webauthn's create() checks
sameOriginWithAncestorsand returns an error if cross-origin, because a permissions policy (nee Feature Policy) is presently instantiated only for webauthn's get()(i.e., [DiscoverFromExternalSource]). - whether or not a webauthn get() operation occurred cross-origin is recorded in webauthn's
CollectedClientData.
| 7. If <code>|options|.{{CredentialCreationOptions/signal}}</code>'s [=AbortSignal/aborted | ||
| 7. Let |key| be the result of [=map/getting the key=] of |options|. | ||
|
|
||
| Note: |options| has been shown to have exactly one |key| due to steps 5 and 6.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this kind of thing, Assert: might be more appropriate than Note:.
| : {{Credential/[[type]]}} | ||
| :: The {{PasswordCredential}} [=interface object=] has an internal slot named `[[type]]` whose | ||
| value is "<dfn const for="Credential/[[type]]">`password`</dfn>". | ||
| value is "<code><dfn const for="Credential/[[type]]">password</dfn></code>". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change from `...` to <code>...</code> here? It seems to run counter to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what I was thinking there, please ignore.
|
@mikewest -- thanks for your review of this from eons ago. Working on this Credman spec was on the far back burner for quite a while given more urgent priorities. Though priorities have since evolved and Credman is being put back on a front burner. All: I'm abandoning this PR because it encompasses too many incongruent concurrent changes (both editorial and technical), and would be a pain to rebase onto the current state of the "main" branch. It is superseded by PR #182 (which is much more succinct). |
update 21-Aug-2019: this is a work-in-progress. It is not ready to re-review as yet. I'm pushing WIP commits to this branch in my fork as I go along... I'll add another update above this one when it's ready for review. thanks.
nominally fixes #136 improves #135
cc: @agl
Preview | Diff