Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML: cross-site SharedArrayBuffer ought to not work #17909

Merged
merged 1 commit into from
Aug 26, 2019

Conversation

annevk
Copy link
Member

@annevk annevk commented Jul 18, 2019

This is not great, but then Firefox does not ship SAB yet. I guess we did not test this since we did not have cross-site domains back in the day.

Please review #17761 first, this builds on that.

@annevk annevk changed the base branch from master to annevk/sab-infra July 19, 2019 13:03
@annevk annevk force-pushed the annevk/cross-site-sab-via-popup branch 2 times, most recently from ea66246 to ffc0177 Compare July 19, 2019 14:14
@annevk annevk changed the title HTML: SharedArrayBuffer, cross-site, popups HTML: cross-site SharedArrayBuffer ought to not work Jul 19, 2019
@annevk annevk marked this pull request as ready for review July 19, 2019 14:15
@annevk annevk force-pushed the annevk/cross-site-sab-via-popup branch from ffc0177 to 3aebe61 Compare July 19, 2019 15:14
@annevk annevk changed the base branch from annevk/sab-infra to master August 6, 2019 11:49
@annevk annevk force-pushed the annevk/cross-site-sab-via-popup branch from 3aebe61 to 848c0fc Compare August 6, 2019 11:50
@annevk
Copy link
Member Author

annevk commented Aug 22, 2019

To be clear, this is ready for review/suggestions.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JS/HTML LGTM, but I know nothing about the headers

@yutakahirano
Copy link
Contributor

Sorry for the delay... Can you point me a link to the spec/document describing reasoning?

@annevk
Copy link
Member Author

annevk commented Aug 23, 2019

Why shared memory is not cross-site? Because of browsers wanting one-process-per-site and cross-process shared memory not being a thing we want to expose to sites (or necessarily being a thing all architectures support). This follows from how agent clusters are defined, with whatwg/html#4361 and associated PR improving on that.

const frame = document.createElement("iframe");
t.add_cleanup(() => frame.remove());
frame.src = get_host_info().HTTPS_NOTSAMESITE_ORIGIN + new URL("resources/iframe-failure.html", location).pathname;
window.onmessage = t.unreached_func("Got a message event, expected a messageerror event");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+frame.onerror = t.unreached_func(...);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As that event is not defined for that element I'd rather not add that in case we want to add it in the future.

@yutakahirano
Copy link
Contributor

Thank you!

@annevk annevk merged commit 79aac25 into master Aug 26, 2019
@annevk annevk deleted the annevk/cross-site-sab-via-popup branch August 26, 2019 08:08
annevk added a commit to whatwg/html that referenced this pull request Jun 29, 2020
A top-level navigation response with Cross-Origin-Opener-Policy set to same-origin and Cross-Origin-Embedder-Policy set to require-corp will create a cross-origin isolated browsing context group. And all agent clusters therein will be cross-origin isolated as well (shared and service workers can still not be, as they sit on the side).

This change also:

* Gates SharedArrayBuffer exposure behind that primitive for web compatibility reasons.
* Gates SharedArrayBuffer sharing behind that primitive.
* Exposes it through self.crossOriginIsolated.
* Makes document.domain return before it mutates the origin.
* Makes agent clusters keyed on origin.

Tests:

* web-platform-tests/wpt#17719
* web-platform-tests/wpt#17760
* web-platform-tests/wpt#17761
* web-platform-tests/wpt#17802
* web-platform-tests/wpt#17909
* web-platform-tests/wpt#18543
* web-platform-tests/wpt#20116
* web-platform-tests/wpt#22358

Closes #4732. Closes #5122. Closes #5444.

Follow-up: #5435.
annevk added a commit to whatwg/html that referenced this pull request Jul 8, 2020
A top-level navigation response with Cross-Origin-Opener-Policy set to same-origin and Cross-Origin-Embedder-Policy set to require-corp will create a cross-origin isolated browsing context group. And all agent clusters therein will be cross-origin isolated as well (shared and service workers can still not be, as they sit on the side).

This change also:

* Gates SharedArrayBuffer exposure behind that primitive for web compatibility reasons.
* Gates SharedArrayBuffer sharing behind that primitive.
* Exposes it through self.crossOriginIsolated.
* Makes document.domain return before it mutates the origin.
* Makes agent clusters keyed on origin.

Tests:

* web-platform-tests/wpt#17719
* web-platform-tests/wpt#17760
* web-platform-tests/wpt#17761
* web-platform-tests/wpt#17802
* web-platform-tests/wpt#17909
* web-platform-tests/wpt#18543
* web-platform-tests/wpt#20116
* web-platform-tests/wpt#22358

Closes #4732. Closes #5122. Closes #5444.

Follow-up: #5435 (and #5362).
mfreed7 pushed a commit to mfreed7/html that referenced this pull request Sep 11, 2020
A top-level navigation response with Cross-Origin-Opener-Policy set to same-origin and Cross-Origin-Embedder-Policy set to require-corp will create a cross-origin isolated browsing context group. And all agent clusters therein will be cross-origin isolated as well (shared and service workers can still not be, as they sit on the side).

This change also:

* Gates SharedArrayBuffer exposure behind that primitive for web compatibility reasons.
* Gates SharedArrayBuffer sharing behind that primitive.
* Exposes it through self.crossOriginIsolated.
* Makes document.domain return before it mutates the origin.
* Makes agent clusters keyed on origin.

Tests:

* web-platform-tests/wpt#17719
* web-platform-tests/wpt#17760
* web-platform-tests/wpt#17761
* web-platform-tests/wpt#17802
* web-platform-tests/wpt#17909
* web-platform-tests/wpt#18543
* web-platform-tests/wpt#20116
* web-platform-tests/wpt#22358

Closes whatwg#4732. Closes whatwg#5122. Closes whatwg#5444.

Follow-up: whatwg#5435 (and whatwg#5362).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants