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

Explore implications of crossOriginIsolated #26

Open
TheUnlocked opened this issue Mar 25, 2022 · 0 comments
Open

Explore implications of crossOriginIsolated #26

TheUnlocked opened this issue Mar 25, 2022 · 0 comments
Labels
enhancement New feature or request investigation Exploring potential features or changes

Comments

@TheUnlocked
Copy link
Owner

TheUnlocked commented Mar 25, 2022

For context, crossOriginIsolated is required for certain features like SharedArrayBuffer, which is necessary to support REPL behavior in languages compiled via empscripten, such as Chez Scheme (https://github.com/TheUnlocked/scheme-js). That's because reading from stdin is a synchronous operation, and in order to make it asynchronous the language runtime has to be executed in a worker and suspended when stdin isn't available with Atomics.wait, which requires a SharedArrayBuffer. These languages can still be used without it, but they cannot be used interactively, which is a significant drawback.

I've created https://github.com/TheUnlocked/Necode/tree/experimental-iframe-crossOriginIsolated to try out Necode with the necessary security features in place to support crossOriginIsolated. Specifically, these two headers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentialless

Currently the only major drawback I've found is that cross-origin iframes are not supported, which could theoretically break some instructor use cases. Because this must be site-wide in order for crossOriginIsolated to be true, providing some kind of configurable toggle for it is not tenable--everything needs to just work.

Patching iframes to be anonymous is viable, though anonymous iframes have not yet shipped in any browser. Merging in this change should at least wait until it does, even if no other issues pop up.

@TheUnlocked TheUnlocked added enhancement New feature or request investigation Exploring potential features or changes labels Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigation Exploring potential features or changes
Projects
None yet
Development

No branches or pull requests

1 participant