WICG / proposals

A home for well-formed proposed incubations for the web platform. All proposals welcome.
https://wicg.io/
Other
233 stars 16 forks source link

Realms Initialization Control #144

Closed weizman closed 5 months ago

weizman commented 7 months ago

Introduction

The proposal for Realms Initialization Control (referred to as RIC) allows developers to securely tap into the creation moment of same origin realms within their web application in order to tame and control them.

Motivation

Goals

The browser is already capable of enforcing rules on new realms before they become reachable, and it is where the same origin concern should also be addressed.

Proposal

Initialization of same origin realms in an application should be under that application's control.

This proposal describes an opt-in capability to set a script to be loaded first, everytime a same origin realm with synchronous access to the main execution environment of the application is created.

The location of the script can be relative or absolute. Secure connection is required. The proposed method for setting the script is a Content Security Policy directive as follows:

Content-Security-Policy: "realm-init: /scripts/on-new-same-origin-realm.js"

Resources

Explainer

Read the complete Explainer.

Feedback

I welcome feedback in this thread, but encourage you to file bugs against the Explainer.

nicjansma commented 5 months ago

@weizman really cool idea here!

Akamai has a few products that could use something like this:

If there was support for something like this added to the browser I'm sure we'd consider using it to harden our existing "patching" techniques.

weizman commented 5 months ago

As a former PerimeterX employee, I relate to literally 100% of what you wrote šŸ˜‰ Let's do it @nicjansma! Could you please add this to the "usecases" issue on the explainer repo? After having some, I'll introduce all into the md document of the official explainer, could be really helpful šŸ™šŸ»

yoavweiss commented 5 months ago

With my Shopify hat on, we are supportive of this effort and could make use of something of this nature in our various code sandboxes.

Switching hats to my (virtual) WICG co-chair one, this seems enough support for us to move the repo to the WICG org. Let's discuss details offline.

weizman commented 5 months ago

Awesome news @yoavweiss!

  1. I would love to talk details with you on how to proceed, let's do that.
  2. We would love to get more insights into your use case so it could be documented into the explainer. Could we add a small paragraph on shopify's use case for this in the "use cases" issue under the official explainer repo?
yoavweiss commented 5 months ago

The repo now lives at https://github.com/WICG/Realms-Initialization-Control Happy incubating!!