-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
COEP and COOP inheritance for top level non-HTTP documents #6552
Comments
Maybe related in WICG/webpackage: |
@arturjanc @annevk I guess you'll have opinions on this. |
I recall that the idea was that COEP would only ever inherit downward and not into popups (except as part of COOP's special same-origin-plus-coep). But maybe that's only specified as far as enforcing COEP goes. I'm not sure how reasonable that is for local schemes, but let's consider it. For |
This comment has been minimized.
This comment has been minimized.
It's secure (or at least as secure as we know how to make it), whether it's trustworthy very much depends on your threat model and the relevant party. (It's not a great name, but this isn't the place to discuss that.) |
IIUC you suggest that COEP is deduced from COOP special
Interesting, I'd have expected a similar inheritance for the blob than for the
I'm not sure I get the conclusion. Do you mean it is fine that
👍 |
The idea (not sure how great it is still) is to inherit COEP downward (i.e., nested documents), but not upward/sideward (i.e., top-level documents) for relevant local schemes. I could see inheriting COOP for I mean that we don't inherit COEP for |
If I understand you correctly, you're saying it is fine if we have a top level Note that Chromium inherits here, I think Firefox does too, for instance: main frame on https://first-party-test.glitch.me/?coep=require-corp&coop=same-origin&
The iframe won't load. Without COEP the iframe will load. COOP for |
No, if COOP is same-origin-plus-coep COEP should be require-corp. You do get inheritance in that case (but it's "through COOP"). |
Ok thanks for clarifying! In my example, Chromium's behavior is wrong then (As it inherits even without COOP), I'm not sure how to interpret Firefox's, the iframe is blocked but I'm not sure due to what. |
If you try to deduce
There are a few properties I think we want to preserve:
I realize I am only trying to find problem in previous solutions, but I am not trying to work on a solution myself. So I feel obligated to propose something. Not sure how great it will be. The fact that COOP is somewhat tied to COEP makes things hard. I believe blocking things is easier than trying to imagine a working inheritance mechanism. Every new document are created by a navigation, except the initial empty document. So we probably should distinguish the two:
|
I would like to avoid introducing a new case of opening a popup with rel no-opener if we can avoid it. For the case 1, I'd rather we follow COOP inheritance: i.e. inherit the top-level COEP of your page if you are same-origin with the top-level document. |
I would be happy not to, if there are better alternatives. So, for the initial empty document in popup, you propose inheriting COEP from the opener's top-level document instead of the current behavior: inheriting from the opener. |
How about we inherit COEP from the creator if we determine that the COOP value is same-origin-plus-coep and otherwise we do not inherit COEP at all? |
This comment has been minimized.
This comment has been minimized.
Is this the same as what I proposed? I believe the single difference is: In your proposition, you don't add "noopener". Is this what you meant? The difficulty I have with not adding "noopener" is that in this case, the initial empty document inherits its capability to fetch from the creator, and this capability is already bound to a COEP policy. When setting the initial empty document's COEP, we aren't really enforcing anything new, we are just reflecting what is already in use. |
Yeah, I think so. I think it would be rather strange to force noopener because of creator's COEP. Unless COEP is applied together with COOP, there is essentially no consistency as you could typically find another document to fetch from (at least in these same-origin scenarios). |
Yes, indeed. I agree you with you. What I proposed isn't great. I am looking into (4) from @ParisMeuleman proposition. If we don't want "noopener", and can't inherit COEP outside of the creator for the initial empty document, then this might be a good solution. |
regarding 4), while it seems like a reasonable option to me, I'm not sure to understand what [should] happens in the following cases:
|
=> I would assume yes to both. The current specified logic about browsing context group swap applies.
=> Yes: |
When creating a new browsing contexts, COOP is inherited from the opener's top level document, and COEP from the opener.
In #5198, we also clarify COOP inheritance for non-HTTP documents beyond the initial empty document. COEP inheritance for this case is not clear to me.
This inheritance seems to be problematic in the following case:
same-origin
, COEP:unsafe-none
.require-corp
.According to the rules above, C's initial empty document should have COOP:
same-origin
and COEP:require-corp
. This is problematic since an HTTP response with COOP:same-origin
and COEP:require-corp
would lead to a COOP value ofsame-origin-plus-coep
.I would suggest we adopt one of the following inheritance strategies for the initial empty document
same-origin
we force COEP tounsafe-none
. It is unclear however what we should do to COEP for COOPsame-origin-allow-popups
and COOPunsafe-none
.noopener
, no COOP/COEP will be applied. the trigger will probably be if opener’s COOP ==same-origin
and opener’s COEP ==require-corp
.same-origin
and COEPrequire-corp
; i.e. we accept the discrepancy in the COOP value.same-origin-plus-coep
and open the popup in a different browsing context group. I'm not sure this is feasible (beyond using noopener).Regarding D case, D's document (loaded from a local scheme url) should have COOP:
same-origin
, but COEP is unclear to me.I suggest we apply a COEP inheritance here that matches what we decide for the initial empty document.
same-origin-plus-coep
, this should trigger a browsing context group switch.same-origin
and COEPrequire-corp
, accepting the discrepancy.I am not sure what we prefer here. 4 in both scenarios seems acceptable as I think it would minimize the risk of breakages during deployment of COEP to the embedded frames. I'm just a bit worried
The text was updated successfully, but these errors were encountered: