question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How does a vetted shim extend shared global variables?

See original GitHub issue

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 what lockdown() locks down.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kriskowalcommented, Mar 16, 2021

I would like to investigate this plan:

lockdown remains as-is. We add a repair function that lockdown will call if it hasn’t already been called. We introduce some mechanism for modifying the SES allow-list between repair and lockdown, so an application has an interval in which it can run shims and bless whatever properties it wants to stick afterward.

0reactions
Jack-Workscommented, Jun 17, 2022

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: https://github.com/zloirock/core-js/issues/1092

Read more comments on GitHub >

github_iconTop Results From Across the Web

Realms and Evaluator Shim Security - Agoric
Instead, each evaluation takes place in a “compartment” which has its own separate global object, that contains none of the powerful platform ...
Read more >
The Problems with Global Variables - Embedded Artistry
Shared global data can be reduced in scope by rethinking how your source code is organized: arrange your source files based on access...
Read more >
Array.prototype.push has extra "prototype" property #1092
core-js polyfills should work everywhere - even in ES3 - and ... How does a vetted shim extend shared global variables? endojs/endo#318.
Read more >
Key features and benefits | Docker Documentation
It means that the root user (0) in the container is mapped to unprivileged user 100000 in the Docker Desktop Linux VM, and...
Read more >
Global Variables are Evil and Unsafe - ForrestTheWoods
Mutable global state is both unsafe and evil. Programmers who add global ... Linux enables and even encourages shared global variables.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found