Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrote CSP & EcmaScript integration
This reworks how `new Function(source)` and `eval(source)` are checked against a CSP and Trusted Types policy. It trusts TrustedScript when the relevant CSP policies and TrustedType configurations agree on whether to enforce and the TrustedType configuration places limits on policy creation. It also changes the previous language to use *calleeRealm* instead of *callerRealm* for consistency with other sinks. > ```js > let f = new self.top.Function(source); > ``` > In this case, the *callerRealm*'s Window is `self` and the > *calleeRealm*'s Window is `self.top`. > The Trusted Types portion of this algorithm uses *calleeRealm* > for consistency with other sinks. > ```js > // Assigning a string to another Realm's DOM sink uses that > // Realm's default policy. > self.top.body.innerHTML = 'Hello, World!'; > // Using another Realm's builtin Function constructor should > // analogously use that > // Realm's default policy. > new self.top.Function('alert(1)')() > ``` It also makes recent versions of `bikeshed` run without warnings. Fixes w3c#143 Issue w3c#144
- Loading branch information