-
Notifications
You must be signed in to change notification settings - Fork 74
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
Integration with Shadow Realms? #442
Comments
Based on tc39/ecma262#3222 (comment) comments in here about ShadowRealms it seems that it will make use of the host callout so is probably handled by the changes to that automatically but worth keeping in mind at least. |
Yes, we are intentionally keeping this simple, /cc @nicolo-ribaudo |
With the default policy, does this introduce a new communication channel between shadow realms and the outer realm? e.g. function defaultPolicyFallback(message) {
// I have access to the message!
}
new ShadowRealm().importValue("mod.js", "x");
//mod.js
export let x;
try {
eval("message for the outer realm :)")
} catch {} |
It seems that we need more clarifications here. From what I remember (@mhofman keep me honest here), TT is not going to be available inside a ShadowRealm initially. Instead, we only rely on existing mechanism (CSP's hashes) to support eval/evaluate. Similarly, For What about |
That all sounds about right. I am not familiar with policy fallbacks, so I think the question raised by @nicolo-ribaudo is whether any handler set in the main realm should be involved in My understanding is that this is safe since trusted types can only allow things that would otherwise be prevented by base CSP rules? Which confirms @caridy's point that you have to rely on hashes instead. Of course for |
I agree that passing the param of Calls to |
Yeah TT is exposed to workers so the spec would handle non window envs so no strong reason not to expose to shadow realm in future. |
@nicolo-ribaudo I think the question is how to differentiate them? Today, |
I'm unfamiliar with shadow realms as a whole but I see that it introduces some form of script evaluation, does this need to be covered by Trusted Types like eval and Function?
The text was updated successfully, but these errors were encountered: