WICG / isolation

Other
5 stars 7 forks source link

Plan for isolating storage #1

Open jonathanKingston opened 7 years ago

jonathanKingston commented 7 years ago

The current draft mentions isolating local/session storage and also cookies. Will these be added?

Points to consider:

estark37 commented 7 years ago

Hmm. I was really hoping to avoid modifying the definition of origins, but it might be inevitable.

We could follow the suborigins model; however, my concern is that origin serialization is not really extensible (https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin). Suborigins serialize into the host component of an origin, with a suffix on the scheme to indicate that a suborigin is present. It's not easy to extend that to an isolated origin... plus, isolation is even more complicated because we'd have to encode a whole other origin in the serialization. (That is, if https://embedded.com is embedded in https://isolated.com, the serialized origin for embedded.com has to somehow encode the fact that it is embedded in the isolated origin https://isolated.com.)

cc @mikewest @tanvihacks

estark37 commented 7 years ago

On second thought, maybe we don't really need to encode isolation info into an origin serialization. My vague understanding is that suborigins needed to serialize in order for postMessage to work. But in this case we don't really need isolation info in postMessage origins because nothing inside an isolated origin should be able to postMessage outside and vice versa.

Maybe @metromoxie or @devd can elaborate a little more on suborigin serialization. If postMessage didn't exist, would suborigins need to have a special serialization?

devd commented 7 years ago

For CORS too, right? Unless we want to make the origin header null in that case and use a new suborigin header.

estark37 commented 7 years ago

Ah, right, CORS!

I think an isolated origin serialization isn't necessary for CORS; a server doesn't need to distinguish requests coming from an isolated context because the cookies will already be separated.

devd commented 7 years ago

Well, a server might use origin for auth and ignore cookies.

estark37 commented 7 years ago

Eh? Can you explain that more?

devd commented 7 years ago

[chatted offline but we are still figuring out if this applies to isolate me]