Here’s a proposal for new header as I promised.ProposalAdd HTTP header called Cross-Origin-Isolate, which takes a value of 0 and 1. When the HTTP response of a document contains Cross-Origin-Isolate header with its value set to 1, the document is said to be "isolated".Let document A and document B be cross-origin documents.If document B is “isolated”, then document B's window acts as if its browsing context has been discarded (i.e. as if window has been closed) to document A. Similarly, document A's window acts if its browsing context has been discarded to document B.That is, each document appears to one another if is the other document's frame/window to be closed. On same origin access, the header has no effect.Let's say document B opened document A via `window.open`. Then window proxy of document B in document A's global object looks as if document B has been closed. i.e. `window.closed` is true. Similarly, document B's `window.opener` is NOT null but looks closed as well (i.e. `window.opener.closed` is true).Let's say document A opened document A via `window.open`. In this case, window proxies in both documents behave exactly like in the previous case.Let's say document A has an iframe of a document B. Then iframe's `contentWindow` in document A looks like closed; i.e. `iframe.contentWindow.closed` is true. Because it's cross-origin, `iframe.contentDocument` is null. Similarly, `window.parent` in document B looks as if "closed" with `window.closed` set to true. Note that `parent != self` is still true.Spectre Protection PlanFor the purpose of protecting a website a.com from Spectre in browsers which support process swap for top-level navigations without cross-process window proxy support, a.com can set this header on all of its documents (not setting on some would result in leaks; more on this later).If this header is set on a.com, we can swap process on cross-origin navigation from or to a.com's documents because this guarantees that a.com doesn't have access to any other document outside of its origin, and vice versa.Let's say we're on some page B1 in b.com, and it window.open'ed (isolated) a.com. Then b.com doesn't have access to a.com, and b.com doesn't have access to a.com so we can put them into different processes. Obviously, a.com's iframes don't have access to b.com's frame tree either so if Facebook is currently relying on being able to do this, they won't be able to use this header.
Navigation Prevention?One possible addition to this feature might be to prevent all types of navigations. With what we proposed above, it's already the case that an isolated document's location object itself is inaccessible but documents with a window proxy to an isolated document can still navigate it via `iframe.src` or `window.open`. In particular, named frame navigation triggered by anchor element with a named target and/or `window.open` would still navigate the "isolated" document. We can prevent these navigations as well if we wanted. e.g. excluding "isolated" document's frame when choosing a browing context for the target (https://html.spec.whatwg.org/multipage/browsers.html#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name)- R. Niwa
--
You received this message because you are subscribed to the Google Groups "isolation-policy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isolation-poli...@chromium.org.
To post to this group, send email to isolatio...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/isolation-policy/B2816693-3AD6-4E4A-B1EC-469B0BB1355A%40apple.com.
On May 2, 2018, at 12:14 AM, Mike West <mk...@chromium.org> wrote:WebAppSec has been kicking around something vaguely similar for way too long now, so I'm excited about getting something hammered out together (see https://lists.w3.org/Archives/Public/public-webappsec/2017Apr/0071.html for some earlier thoughts). I think the general idea of blocking access to cross-origin properties by modifying the behavior of `WindowProxy` is pretty reasonableI'm curious about some of the mechanics you've chosen, though:1. Why pretend that the window is closed, rather than (for example) throwing `SecurityError` or returning `undefined` on cross-origin access to `WindowProxy` properties (e.g. by modifying https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-getownproperty and/or https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-)). It seems like we'd end up needing to mutate that value back and forth as the browsing context navigated from documents that asked for isolation to documents that didn't, which seems strange.
2. Is `Cross-Origin` enough? I can imagine cases where applications on `x.example.com` and `y.example.com` need to talk to each other in some way to perform some action. It's certainly the simplest place to start, but I wonder if we need/want a site-based model for folks to opt-into.
3. Do you want to carve out an exception for `postMessage()`? We went back and forth on this a bit in the thread linked above, and some folks (like Artur. Hi, Artur!) had strong feelings about the distinction between my opener talking to me, and me talking to my openees.
On May 2, 2018, at 7:24 AM, Andy Paicu <andy...@google.com> wrote:Apart from Mike's questions above I would also like to bring out one particular point:4. What happens if a.com uses the b.com window handle, before b.com has loaded, to (for example) create a function in the b.com window that will execute after b.com loads? Something similar happens when b.com in sandboxed using the CSP header but since there was no way to tell immediately that the opened windows is sandboxed (or in this case that Cross-Origin-Isolate is '1') the opener could still do stuff with the handle before it becomes isolated/sandboxed. Here is a more detailed example of what I mean: 377995
On May 2, 2018, at 12:14 AM, Mike West <mk...@chromium.org> wrote:WebAppSec has been kicking around something vaguely similar for way too long now, so I'm excited about getting something hammered out together (see https://lists.w3.org/Archives/Public/public-webappsec/2017Apr/0071.html for some earlier thoughts). I think the general idea of blocking access to cross-origin properties by modifying the behavior of `WindowProxy` is pretty reasonableI'm curious about some of the mechanics you've chosen, though:1. Why pretend that the window is closed, rather than (for example) throwing `SecurityError` or returning `undefined` on cross-origin access to `WindowProxy` properties (e.g. by modifying https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-getownproperty and/or https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-)). It seems like we'd end up needing to mutate that value back and forth as the browsing context navigated from documents that asked for isolation to documents that didn't, which seems strange.We could consider those options but pretending to be closed seems like the most web compatible option since websites would already have to deal with a closed window.
2. Is `Cross-Origin` enough? I can imagine cases where applications on `x.example.com` and `y.example.com` need to talk to each other in some way to perform some action. It's certainly the simplest place to start, but I wonder if we need/want a site-based model for folks to opt-into.That's certainly a consideration. We can always add those options later though.3. Do you want to carve out an exception for `postMessage()`? We went back and forth on this a bit in the thread linked above, and some folks (like Artur. Hi, Artur!) had strong feelings about the distinction between my opener talking to me, and me talking to my openees.We don't want to support postMessage since it would be odd to support postMessage to a closed window.
On May 3, 2018, at 5:58 AM, Mike West <mk...@chromium.org> wrote:On Thu, May 3, 2018 at 11:14 AM Ryosuke Niwa <rn...@apple.com> wrote:On May 2, 2018, at 12:14 AM, Mike West <mk...@chromium.org> wrote:WebAppSec has been kicking around something vaguely similar for way too long now, so I'm excited about getting something hammered out together (see https://lists.w3.org/Archives/Public/public-webappsec/2017Apr/0071.html for some earlier thoughts). I think the general idea of blocking access to cross-origin properties by modifying the behavior of `WindowProxy` is pretty reasonableI'm curious about some of the mechanics you've chosen, though:1. Why pretend that the window is closed, rather than (for example) throwing `SecurityError` or returning `undefined` on cross-origin access to `WindowProxy` properties (e.g. by modifying https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-getownproperty and/or https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-)). It seems like we'd end up needing to mutate that value back and forth as the browsing context navigated from documents that asked for isolation to documents that didn't, which seems strange.We could consider those options but pretending to be closed seems like the most web compatible option since websites would already have to deal with a closed window.General compatibility with the status-quo seems like less of a concern if this is an opt-in mechanism, doesn't it?
> On May 1, 2018, at 4:20 PM, Charlie Reis <cr...@chromium.org> wrote:
>
>
>
> On Tue, May 1, 2018 at 2:59 PM Ryosuke Niwa <rn...@apple.com> wrote:
>> Here’s a proposal for new header as I promised.
>>
>> Proposal
>>
>> Add HTTP header called Cross-Origin-Isolate, which takes a value of 0 and 1. When the HTTP response of a document contains Cross-Origin-Isolate header with its value set to 1, the document is said to be "isolated".
>>
>> Let document A and document B be cross-origin documents.
>>
>> If document B is “isolated”, then document B's window acts as if its browsing context has been discarded (i.e. as if window has been closed) to document A. Similarly, document A's window acts if its browsing context has been discarded to document B.
>>
>> That is, each document appears to one another if is the other document's frame/window to be closed. On same origin access, the header has no effect.
>>
>> Let's say document B opened document A via `window.open`. Then window proxy of document B in document A's global object looks as if document B has been closed. i.e. `window.closed` is true. Similarly, document B's `window.opener` is NOT null but looks closed as well (i.e. `window.opener.closed` is true).
>>
>> Let's say document A opened document A via `window.open`. In this case, window proxies in both documents behave exactly like in the previous case.
>>
>> Let's say document A has an iframe of a document B. Then iframe's `contentWindow` in document A looks like closed; i.e. `iframe.contentWindow.closed` is true. Because it's cross-origin, `iframe.contentDocument` is null. Similarly, `window.parent` in document B looks as if "closed" with `window.closed` set to true. Note that `parent != self` is still true.
>>
>> Spectre Protection Plan
>>
>> For the purpose of protecting a website a.com from Spectre in browsers which support process swap for top-level navigations without cross-process window proxy support, a.com can set this header on all of its documents (not setting on some would result in leaks; more on this later).
>>
>> If this header is set on a.com, we can swap process on cross-origin navigation from or to a.com's documents because this guarantees that a.com doesn't have access to any other document outside of its origin, and vice versa.
>>
>> Let's say we're on some page B1 in b.com, and it window.open'ed (isolated) a.com. Then b.com doesn't have access to a.com, and b.com doesn't have access to a.com so we can put them into different processes. Obviously, a.com's iframes don't have access to b.com's frame tree either so if Facebook is currently relying on being able to do this, they won't be able to use this header.
>
> What about the case where B iframes A and A opens a popup (e.g., the OAuth case)? More specifically, document B1 in b.com iframes document A1 on (isolated) a.com. As described, B1 and A1 act like they're not in the same frame tree. However, when the user clicks on the login button in A1, A1 opens a top-level popup to document A2 on a.com. Would A2 go into a new process for a.com based on the rules above?
No. In this case, the process which loaded B1 and A1 would also load A2 (in a new window).
> In that case, A1 and A2 couldn't script each other, even though the window.closed rules don't seem to apply in the same-origin case.
Right. This is why we think it’s necessary to keep A2 in the same process which loaded A1.
For this reason, in order to get Spectre protection for your website in a browser which doesn’t support process isolation at frame / window proxy level, websites MUST not have any document which gets loaded inside a cross-origin iframe and MUST set Cross-Origin-Isolate: 1 on every document in the origin which has a secret to protect.
> Let's say now a.com is navigated to some other page B2 in b.com. In this case, the browser finds the process which loaded B1 and load B2 in the same process so that they can talk to one another via window proxies.
>
> Yes. Quick note on Chrome's approach-- we would put B1 and B2 in the same b.com process, but only if they were part of the same "unit of related browsing contexts" (which we call BrowsingInstance). That way, all b.com tabs don't end up in the same process, which gets unusable with a large number of b.com tabs. (Incidentally, this is why we call our policy "one site per process" instead of "process per site." There can be more than one process for a given site.)
Sure, we have a slightly different idea on how to decide when & when not to start a new process but that’s totally possible with the proposed API.
- R. Niwa
--
You received this message because you are subscribed to the Google Groups "isolation-policy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isolation-poli...@chromium.org.
To post to this group, send email to isolatio...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/isolation-policy/2F75B47A-E329-4851-8CF0-8C83046D14D1%40apple.com.
On May 2, 2018, at 12:14 AM, Mike West <mk...@chromium.org> wrote:WebAppSec has been kicking around something vaguely similar for way too long now, so I'm excited about getting something hammered out together (see https://lists.w3.org/Archives/Public/public-webappsec/2017Apr/0071.html for some earlier thoughts). I think the general idea of blocking access to cross-origin properties by modifying the behavior of `WindowProxy` is pretty reasonableI'm curious about some of the mechanics you've chosen, though:1. Why pretend that the window is closed, rather than (for example) throwing `SecurityError` or returning `undefined` on cross-origin access to `WindowProxy` properties (e.g. by modifying https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-getownproperty and/or https://html.spec.whatwg.org/multipage/browsers.html#crossorigingetownpropertyhelper-(-o,-p-)). It seems like we'd end up needing to mutate that value back and forth as the browsing context navigated from documents that asked for isolation to documents that didn't, which seems strange.We could consider those options but pretending to be closed seems like the most web compatible option since websites would already have to deal with a closed window.2. Is `Cross-Origin` enough? I can imagine cases where applications on `x.example.com` and `y.example.com` need to talk to each other in some way to perform some action. It's certainly the simplest place to start, but I wonder if we need/want a site-based model for folks to opt-into.That's certainly a consideration. We can always add those options later though.3. Do you want to carve out an exception for `postMessage()`? We went back and forth on this a bit in the thread linked above, and some folks (like Artur. Hi, Artur!) had strong feelings about the distinction between my opener talking to me, and me talking to my openees.We don't want to support postMessage since it would be odd to support postMessage to a closed window.
> * Why do we need a "0" or "DENY" setting? Just not setting the response header would have the same effect, right?
For web compatibility, the default setting is the status quo, which is ALLOW.
> * Why do we need a "0" or "DENY" setting? Just not setting the response header would have the same effect, right?
For web compatibility, the default setting is the status quo, which is ALLOW.Err, wait. Maybe that's what I meant. :) Do we need ALLOW, then?
On May 7, 2018, at 5:00 PM, Chris Palmer <pal...@chromium.org> wrote:Sorry I've been AWOL lately; super busy with other (related and unrelated) stuff. Broadly, here are some thoughts:* I agree with Artur that we really need to enable postMessage to keep working, at least as an option. I think the extra work will pay off in increased adoption.
* There's Geoff's spelling of the options, which is good. But what about *site* vs. *origin*? It might (?) be helpful to allow a service to tighten itself at either level of granularity, as well.
* Why do we need a "0" or "DENY" setting? Just not setting the response header would have the same effect, right?
* The requirement that a site/origin set the header on every response seems error-prone. Could we use a .well-known URL instead? I guess this re-raises the issue that the Isolation proposal had, of needing to depend on/wait for Origin Policy, which is perhaps undesirable.
Navigation Prevention?One possible addition to this feature might be to prevent all types of navigations. With what we proposed above, it's already the case that an isolated document's location object itself is inaccessible but documents with a window proxy to an isolated document can still navigate it via `iframe.src` or `window.open`. In particular, named frame navigation triggered by anchor element with a named target and/or `window.open` would still navigate the "isolated" document. We can prevent these navigations as well if we wanted. e.g. excluding "isolated" document's frame when choosing a browing context for the target (https://html.spec.whatwg.org/multipage/browsers.html#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name)
On May 17, 2018, at 8:42 AM, 'Stephen Röttger' via isolation-policy <isolatio...@chromium.org> wrote:I'm currently trying to find a good way to mitigate XS-Search attacks and Artur pointed me to this proposal.If it's possible then I'd like to ask to add the navigation prevention as it would be very helpful to protect against XS-Search.
I'm currently trying to find a good way to mitigate XS-Search attacks and Artur pointed me to this proposal.If it's possible then I'd like to ask to add the navigation prevention as it would be very helpful to protect against XS-Search.Agreed, I believe this should the Cross-Origin-Options header should prevent navigations when value is “deny” or “allow-postmessage”.
--
You received this message because you are subscribed to the Google Groups "isolation-policy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isolation-poli...@chromium.org.
To post to this group, send email to isolatio...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/isolation-policy/7AB92247-CBA3-4ACC-808A-9C0DAE2B1C88%40apple.com.
Hi, folks. (And sorry if you get this twice, I sent from the wrong email account initially...)I apologize, as I think I conflated this with the other `Cross-Origin-etc-thing` thread on GitHub. Personally, I think the general direction is a good one, and I think there's value in the mechanism above and beyond Spectre mitigation (I know, for instance, that `doubleclick.net` frames are very interested in preventing other `doubleclick.net` frames from poking at them).It would be helpful to me if someone could summarize the conclusions from this thread into a short document we could skim through together to make sure that I understand where things ended up. I'm not sure about some of the details discussed above (navigation blocking, for instance, might be valuable as a xs-search mitigation, but might also reduce the value for use cases like the ad frame isolation hand-waved at above). Spelling out the details would ensure that we're not accidentally talking past each other.sroettger@: Would `sec-metadata` (https://github.com/mikewest/sec-metadata) address some of the uses you have for navigation blocking? I wonder if that's a better primitive to rely upon here.
On Wed, May 30, 2018 at 7:43 AM Mike West <mk...@chromium.org> wrote:Hi, folks. (And sorry if you get this twice, I sent from the wrong email account initially...)I apologize, as I think I conflated this with the other `Cross-Origin-etc-thing` thread on GitHub. Personally, I think the general direction is a good one, and I think there's value in the mechanism above and beyond Spectre mitigation (I know, for instance, that `doubleclick.net` frames are very interested in preventing other `doubleclick.net` frames from poking at them).It would be helpful to me if someone could summarize the conclusions from this thread into a short document we could skim through together to make sure that I understand where things ended up. I'm not sure about some of the details discussed above (navigation blocking, for instance, might be valuable as a xs-search mitigation, but might also reduce the value for use cases like the ad frame isolation hand-waved at above). Spelling out the details would ensure that we're not accidentally talking past each other.sroettger@: Would `sec-metadata` (https://github.com/mikewest/sec-metadata) address some of the uses you have for navigation blocking? I wonder if that's a better primitive to rely upon here.The only difference I can think of is the point jannh brought up. sec-metadata would still allow you to change the hash of the window since it will not trigger a page load. If the website is designed to search based on hash changes they would still be vulnerable (gmail is doing this atm).