-
Notifications
You must be signed in to change notification settings - Fork 11
Run the CORP check while processing navigation response #11
Run the CORP check while processing navigation response #11
Conversation
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967
ping |
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#745857}
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#745857}
This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#745857}
I think this check is run too late as it wouldn't be run for redirect responses. This might be a problem in how set things up in HTML to begin with though. @domenic and I were looking at this the other day and there might be room for improvement here. E.g., I notice that the current setup would also not enforce |
Thank you! I moved the insertion point from "process navigate a response" to "process navigate a fetch". |
Note that Chrome doesn't enforce XFO on redirects. I don't think Firefox or Safari do either, though I haven't checked at all recently. See the data I pasted into web-platform-tests/wpt#21730 (comment), and the underlying discussion in https://crbug.com/835465. That said, I think it's quite reasonable to make a different decision here and enforce COEP/CORP on redirect responses, since this mechanism is new and we can do the right thing from the get go. |
index.bs
Outdated
For every navigation request for a nested browsing context whose parent's embedder | ||
policy is "`require-corp`", CORP is checked. | ||
|
||
Run the following step before the sixth step of [=process a navigate fetch=]. |
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.
Note that this runs before frame-ancestors
checks, which sounds fine. I don't think there's any good reason to prefer one ordering to the other, but it's something we should probably lock down in tests so that the right set of things get reported consistently across browsers.
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.
Ack.
index.bs
Outdated
For every navigation request for a nested browsing context whose parent's embedder | ||
policy is "`require-corp`", CORP is checked. |
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.
You'll want to add this to the list of changes in https://mikewest.github.io/corpp/#integration-html (around line 333). It might be reasonable to drop this whole section in favor of simply monkey-patching there, or it may make sense to label the following as an algorithm that's called-out-to in the same way we do for "process a navigate response". I'm happy either way. Depending on which route you take, I'd adjust this text accordingly, perhaps copy/pasting the existing "process a navigation response" text, a la:
For every navigation request for a nested browsing context whose parent's embedder | |
policy is "`require-corp`", CORP is checked. | |
If a document's [=document/embedder policy=] is "`require-corp`", then any document it embeds in a | |
[=nested browsing context=] must positively assert a "`require-corp`" [=/embedder policy=] (see | |
[[#cascade-vs-require]]). Here, we modify HTML's [=process a navigation fetch=] algorithm to perform | |
the CORP check upon each redirect in a navigation chain. |
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 inlined the section. Does it look good?
|
||
1. If |response| is not a `Response` object, or the result of performing a | ||
1. If |response| is not a `Response` object, or _event_'s request's associated request's | ||
[=request/mode=] is "`no-cors`" and the result of performing a |
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.
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.
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.
Now #9 is merged so hopefully this change is clear enough.
dcd0828
to
3a1b259
Compare
That sounds great and happy to give old policies an exception (for now). |
f670bc8
to
148ee1f
Compare
In order to run the CORP check for main resources for nested frames, run the CORP check in the "process navigation response" algorithm. This is needed because we want to run the CORP check against the parent frame's origin, not the origin of the source browsing context. Fixes whatwg/html#5308. Co-Authored-By: Mike West <mike@mikewest.org>
148ee1f
to
8fe7a55
Compare
I think I addressed all the comments. PTAL again. |
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. Thanks for iterating on this.
…testonly Automatic update from web-platform-tests Run CORP on nested frame navigations This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#745857} -- wpt-commits: 52191577ce292eed7bf42651764b8010b112ec8c wpt-pr: 21943
…testonly Automatic update from web-platform-tests Run CORP on nested frame navigations This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Cr-Commit-Position: refs/heads/master@{#745857} -- wpt-commits: 52191577ce292eed7bf42651764b8010b112ec8c wpt-pr: 21943
…testonly Automatic update from web-platform-tests Run CORP on nested frame navigations This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Yutaka Hirano <yhiranochromium.org> Cr-Commit-Position: refs/heads/master{#745857} -- wpt-commits: 52191577ce292eed7bf42651764b8010b112ec8c wpt-pr: 21943 UltraBlame original commit: 4f49d0f971bf8d187409fcd5cda3dab341b46bbc
…testonly Automatic update from web-platform-tests Run CORP on nested frame navigations This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Yutaka Hirano <yhiranochromium.org> Cr-Commit-Position: refs/heads/master{#745857} -- wpt-commits: 52191577ce292eed7bf42651764b8010b112ec8c wpt-pr: 21943 UltraBlame original commit: 4f49d0f971bf8d187409fcd5cda3dab341b46bbc
…testonly Automatic update from web-platform-tests Run CORP on nested frame navigations This implements WICG/cross-origin-embedder-policy#11. Change-Id: I7bb07f0616cc947c8a84fa140af58984046c7587 Bug: 887967 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066358 Reviewed-by: Kinuko Yasuda <kinukochromium.org> Commit-Queue: Yutaka Hirano <yhiranochromium.org> Cr-Commit-Position: refs/heads/master{#745857} -- wpt-commits: 52191577ce292eed7bf42651764b8010b112ec8c wpt-pr: 21943 UltraBlame original commit: 4f49d0f971bf8d187409fcd5cda3dab341b46bbc
In order to run the CORP check for main resources for nested frames,
run the CORP check in the "process navigation response" algorithm.
This is needed because we want to run the CORP check against the
parent frame's origin, not the origin of the source browsing context.
Fixes whatwg/html#5308.