Skip to content

Commit

Permalink
Prohibit Create Credential from cross-origin iframes
Browse files Browse the repository at this point in the history
This reverts part of PR #1276, again prohibiting the use of the Create method
when `sameOriginWithAncestors` is `false`. The `Note` is simplified, since
the integration between Credential Management and Feature Policy is now
complete.
  • Loading branch information
jcjones committed Mar 24, 2020
1 parent ae29ff0 commit c7a8576
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,10 @@ When this method is invoked, the user agent MUST execute the following algorithm

1. Assert: <code>|options|.{{CredentialCreationOptions/publicKey}}</code> is [=present=].

1. If <var ignore>sameOriginWithAncestors</var> is [FALSE], return a "{{NotAllowedError}}" {{DOMException}}.

Note: This "sameOriginWithAncestors" restriction aims to address a tracking concern raised in [Issue #1336](https://github.com/w3c/webauthn/issues/1336). This may be revised in future versions of this specification.

1. Let |options| be the value of <code>|options|.{{CredentialCreationOptions/publicKey}}</code>.

1. If the {{PublicKeyCredentialCreationOptions/timeout}} member of |options| is [=present=], check if its value lies within a
Expand Down Expand Up @@ -3002,7 +3006,6 @@ Its [=default allowlist=] is '<code>self</code>'. [[!Feature-Policy]]

A {{Document}}'s [=Document/feature policy=] determines whether any content in that <a href="https://html.spec.whatwg.org/multipage/dom.html#documents">document</a> is
[=allowed to use|allowed to successfully invoke=] the [=Web Authentication API=], i.e., via
<code><a idl for="CredentialsContainer" lt="create()">navigator.credentials.create({publicKey:..., ...})</a></code> and
<code><a idl for="CredentialsContainer" lt="get()">navigator.credentials.get({publicKey:..., ...})</a></code>.
If disabled in any document, no content in the document will be [=allowed to use=]
the foregoing methods: attempting to do so will [return an error](https://www.w3.org/2001/tag/doc/promises-guide#errors).
Expand Down

0 comments on commit c7a8576

Please sign in to comment.