WICG / origin-policy

[On hold for now] A mechanism for origins to set their origin-wide configuration in a central location
Other
33 stars 16 forks source link

Potential other uses for origin policy brought up at BlinkOn #52

Open domenic opened 4 years ago

domenic commented 4 years ago

Yesterday at BlinkOn folks brought up two potential uses for origin policy I hadn't heard before. I'd like to record them here and get folks' thoughts, if any.

annevk commented 4 years ago

I'm not sure what you mean by rendered, but the browser has the ability to block the moment the headers are processed as part of HTML's navigation algorithm (not entirely integrated yet, there's an open issue). I agree that blocking before the request is even made (when there's a cached policy) is a nice win though.

mikewest commented 4 years ago

ERP

My recollection is that the objections to ERP were philosophical, not practical. If there's interest in spinning it up again, I agree that origin policy would be a good place to put its configuration.

frame-ancestors

A few thoughts here:

  1. Fetch Metadata will allow servers to distinguish frame requests via Sec-Fetch-Dest: iframe, and refuse to pass them on to the backend, which should both save resources and limit potential leakage.

  2. I think the rendering point is an artifact of Blink's current behavior in stable, wherein CSP is processed in the renderer, while XFO is processed in the browser. For frame-ancestors, we do commit the navigation, then discover that we ought to block it. @annevk is entirely correct that we can block the response in the network service instead, and indeed there's work underway to move our implementation there (https://cs.chromium.org/chromium/src/content/browser/frame_host/ancestor_throttle.cc?rcl=aeec2ba175b9cbefda5d7d416edff684f2db97ef&l=150).

  3. Making decisions a priori is, indeed, a great way to make use of the cached policy. That's very much in line with what we want to do for CORS preflights, I think it's a great idea to do it for ancestor checks as well.

eeeps commented 4 years ago

Something that came up in discussions after the Origin Trials session was the potential to use Origin Policy to opt into an Origin Trial.

Makes sense; also probably doesn't belong in the spec, as a vendor-specific thing.

It does make me wonder if there will be other vendor-specific things, and if that's something the spec should either be on guard against or make affordances for.