Skip to content

Automatic origin isolation of site = origin cases might not be web compatible #5940

@domenic

Description

@domenic

In WICG/origin-agent-cluster#31 @csreis, @annevk and I decided that cases where site = origin should have window.originIsolated return true, because those sites are "automatically origin isolated".

However, when going to implement this (https://chromium-review.googlesource.com/c/chromium/src/+/2426609), I realized this has more impact than we might have anticipated. In particular, being origin-isolated turns off document.domain.

This means that, in the current HTML Standard, sites accessed via IP addresses cannot use document.domain. This breaks at least one Chrome test, and more importantly, it seems likely that sites in the wild are using this. Concretely, before merging origin isolation into HTML, https://192.168.0.1:8080 could set document.domain = "192.168.0.1" and get access to all other ports hosted on that IP. Now, it cannot; https://html.spec.whatwg.org/#relaxing-the-same-origin-restriction:origin-isolated will trigger and make that setter do nothing. This seems especially likely because the HTML Standard has a warning about how dangerous this scenario is; I assume the reason such a warning was added, is because people were actually doing it.

Other cases of interest are sites hosted on a public suffix (e.g., https://github.io/), and file: URLs (whose origin is sometimes opaque, at browser discretion). But the IP address case seems the most worrisome; I find it unlikely that people are using document.domain in the other cases.


As much as I'd like to break document.domain in more cases, I think this deserves more discussion, because I don't think anyone anticipated this in WICG/origin-agent-cluster#31.

Possible courses of action:

  1. Revisit the decision in API concerns for originIsolationRestricted WICG/origin-agent-cluster#31, and don't count IP address pages as automatically origin-isolated. Maybe only count pages that explicitly set the header as such.

  2. Treat this as part of the overall document.domain deprecation program. So, in Chromium we'd initially not automatically origin-isolate these pages, but we'd add a use counter for how many times such pages set document.domain, and if that use counter is low, we'd separately turn on automatic origin isolation for them.

If we take route (2), there's an open question as to what we should do with the spec in the meantime, while Chromium is testing if this is web-compatible.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatStandard is not web compatible or proprietary feature needs standardizingtopic: origin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions