-
Notifications
You must be signed in to change notification settings - Fork 75
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
How does a vetted shim extend shared global variables? #318
Comments
It looks like Similarly, I'm adding these here because the mechanisms this taming code will use to express this probably should be related to the mechanism by which we add shimmed global to the list of new shared globals. |
We still need to confront this design issue. @kriskowal @dckc ok if I assign the three of us? |
I would like to investigate this plan:
|
I don't understand the role of this endo/packages/ses/src/lockdown-shim.js Line 104 in 992f35f
Or is it provided as a parameter to lockdown, such that it runs the shims when lockdown calls it back? |
I’m imagining usage like: // start-lockdown-ses.js
repair(); // finish-ses-lockdown.js
lockdown(); // vetted-shim-lockdown.js
lockdown.pleaseKeepThisFunctionAroundTBD(Array.prototype, 'includes'); // ses-lockdown.js
import 'ses';
import './start-ses-lockdown.js';
import './vetted-shim.js';
import './vetted-shim-lockdown.js';
import './finish-ses-lockdown.js'; |
I believe this becomes urgent. SES lockdown now fails on core-js 3.23 and it cannot be fixed on the core-js side. See discussion in: zloirock/core-js#1092 |
We have answered this question with the separation of This should get us out of most situations. We might need a mechanism in the future to add new shared intrinsics or behavior for creating new per-compartment intrinsics, which we can track separately when we find a motivating case. |
Every time a new compartment is created, its new global object is initialized by default with a standard set of global variable bindings hard coded in the ses whitelists. However, sometimes to purpose of a vetted shim is to add a new "standard" global that is not standard yet, that should be implicitly propagated to new globals just as
Array
is. It is not clear how a vetted shim should express this. For legacy vetted shims, it is even less clear how or whether we should automatically infer this.Correlated with this, host independent vetted shims need not run in the dangerous all powerful start compartment. But they still need to run before
lockdown()
. Perhaps we support a pattern with user-level libraries, where a new default-powerless compartment is made to run the vetted shims in, and the globals those shims leave behind gets added to the implicitly propagated shared globals. If so, these new globals must also be included in whatlockdown()
locks down.The text was updated successfully, but these errors were encountered: