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

Realms Initialization Control #985

Closed
1 task done
weizman opened this issue Aug 28, 2024 · 7 comments
Closed
1 task done

Realms Initialization Control #985

weizman opened this issue Aug 28, 2024 · 7 comments
Assignees
Labels
Mode: breakout Work done during a time-limited breakout session Resolution: unsatisfied The TAG does not feel the design meets required quality standards Venue: TC39 Venue: WebAppSec WG

Comments

@weizman
Copy link

weizman commented Aug 28, 2024

こんにちは TAG-さん!

I'm requesting a TAG review of Realms Initialization Control.

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, every time 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" so that the on-new-same-origin-realm.js script will execute before any other JavaScript code executes in the top realm execution environment, as well as any other child realm that matches its origin.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • The group where the incubation/design work on this is being done (or is intended to be done in the future): WICG
  • Existing major pieces of multi-implementer review or discussion of this design: None atm
  • Major unresolved issues with or opposition to this design: None atm
  • This work is being funded by: ConsenSys
@jyasskin
Copy link
Contributor

Are you planning to, or have you talked to WebAppSec and TC39 about this feature?

@weizman
Copy link
Author

weizman commented Aug 29, 2024

Sure did, the community was rather interested in solving this issue as well as in the manner suggested:

(edit: as well as accepted to the WICG of course)

@weizman
Copy link
Author

weizman commented Sep 12, 2024

Is there any other information I can provide to assist you @jyasskin?

@jyasskin
Copy link
Contributor

Sorry for dropping this. Secure the Web Forward isn't either of WebAppSec or TC39. Do you need introductions into those communities? I'm inclined to think that this is reasonable, but those communities have the deep expertise to notice risks or smoother ways to do this.

@weizman
Copy link
Author

weizman commented Sep 29, 2024

Fair enough, thanks @jyasskin for the clarification.

Driven by your feedback, I pitched RIC to the WebAppSec group at last week's TPAC.
From my perspective, while folks helped nudge us in better directions regarding some of our takes, it seems that in general they were somewhat interested in this proposal and what it'll help deliver.

The recording isn't out yet, but from what I recall, the minutes really capture the gist of the conversation rather well, given how it was only 15 minutes long - 2024-09-26-TPAC-minutes.md#realms-initialization-control (cc @yoavweiss)

@torgo torgo added this to the 2024-10-07-week milestone Oct 4, 2024
@plinss plinss added Progress: in progress Mode: breakout Work done during a time-limited breakout session and removed Progress: untriaged labels Oct 9, 2024
@jyasskin
Copy link
Contributor

We talked about this in our breakout today, and we're very concerned about a belief that one can make a Javascript environment secure against hostile Javascript by running first. We think WebAppSec and TC39 have relevant experience in this space, and you should make sure they're both happy with this before moving forward.

@jyasskin jyasskin added Resolution: unsatisfied The TAG does not feel the design meets required quality standards and removed Progress: in progress labels Oct 15, 2024
@erights
Copy link

erights commented Oct 16, 2024

We think WebAppSec and TC39 have relevant experience in this space, and you should make sure they're both happy with this before moving forward.

For context, I've been on TC39 since 2007 with a strong focus on security. I believe the following comments speak for many participants on TC39, especially those active in TG3, the Technical Group on JavaScript security.

We talked about this in our breakout today, and we're very concerned about a belief that one can make a Javascript environment secure against hostile Javascript by running first.

At TG3, we tend to avoid the overly broad term "Security", and focus instead on its main components: Integrity, Availability, Confidentiality, as explained at
A Taxonomy of Security Issues for understanding language-based security and modularity.

Starting with EcmaScript 5, we explicitly designed JS so that one can make a Javascript environment secure against hostile Javascript by running first, regarding integrity attacks. The ses-shim is an implementation of Hardened JS as code that runs first, mostly to protect integrity. But
Hardened JS Web Challenge
seems to demonstrate that it also protects confidentiality under limiting assumptions. This challenge is on a web page running in a browser accepting hostile JS after it runs first. It is a subject of Agoric's bug bounty program. For purposes of this conversation, an attack on either integrity or confidentiality would win the point of the challenge.

As A Taxonomy of Security Issues explains, there is no practical defense of availability against hostile code running in the same thread (aka "agent"), and Hardened JS makes no attempt to do so.

Those who believe that a script that runs first cannot defend integrity against hostile JS loaded later should submit guest code that breaks the integrity of the Hardened JS Web Challenge host program.

So, please reopen this bug. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mode: breakout Work done during a time-limited breakout session Resolution: unsatisfied The TAG does not feel the design meets required quality standards Venue: TC39 Venue: WebAppSec WG
Projects
None yet
Development

No branches or pull requests

5 participants