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

COOP: Navigations to non-initial about:blank #6913

Open
cdumez opened this issue Jul 28, 2021 · 2 comments
Open

COOP: Navigations to non-initial about:blank #6913

cdumez opened this issue Jul 28, 2021 · 2 comments
Labels
topic: cross-origin-opener-policy Issues and ideas around the new "inverse of rel=noopener" header.

Comments

@cdumez
Copy link

cdumez commented Jul 28, 2021

I found the following comment in html/cross-origin-opener-policy/navigate-to-aboutblank.https.html WPT test:

Non-initial empty documents (about:blank) should inherit their
cross-origin-opener-policy from the navigation's initiator top level document,
if the initiator and its top level document are same-origin, or default
(unsafe-none) otherwise.

For the first subtest in the test, we have:

  1. A top document of origin A with COOP=same-origin
  2. A child frame of origin A
  3. The child frame opens a new popup to origin A with COOP=same-origin
  4. The child frame navigates the popup to about:blank

The subtest does not expect a browsing context group switch, which I find a bit surprising based on the specification.

Let's consider the final navigation to non-initial "about:blank):
From navigate a fetch (Step 12.5.5):

Set responseOrigin to the result of determining the origin given browsingContext, request's URL, finalSandboxFlags, and incumbentNavigationOrigin.

I believe this would set responseOrigin to origin A (resolved from incumbentNavigationOrigin).

Then step 12.5.6.1 says:

Set responseCOOP to the result of obtaining a cross-origin opener policy given response and request's reserved client.

I believe this would set responseCOOP to 'unsafe-none', no? Since I don't expect the response for about:blank to contain any COOP HTTP header.

If so, this would mean that step 12.5.6.3 would call 'enforcing the response's cross-origin opener policy' and we would decide to do a browsing context group switch. This is because activeDocumentCOOPValue != responseCOOPValue and activeDocumentCOOPValue would be 'same-origin' here.

Am I misinterpreting the spec or is there some text missing in the spec to inherit the responseCOOP from the navigation requester's top document COOP?

@cdumez
Copy link
Author

cdumez commented Jul 28, 2021

cc @camillelamy

@camillelamy
Copy link
Member

Yes this is not currently well defined in the spec. We're working on the inheritance problem as part of the PolicyContainer effort. We do plan to move COOP to be in the PolicyContainer, and integrate it with the COOP check during navigate a fetch. This should spec the inheritance of COOP as expected in the WPT test. The behavior of the WPT is really what we want to have at the end.

@whatwg whatwg deleted a comment from shaikhjavedofficial Jul 29, 2021
@annevk annevk added the topic: cross-origin-opener-policy Issues and ideas around the new "inverse of rel=noopener" header. label Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cross-origin-opener-policy Issues and ideas around the new "inverse of rel=noopener" header.
Development

No branches or pull requests

3 participants