proposal-shadowrealm
SES-shim
proposal-shadowrealm | SES-shim | |
---|---|---|
19 | 13 | |
1,376 | 736 | |
1.2% | 0.7% | |
6.0 | 9.9 | |
12 days ago | 5 days ago | |
HTML | JavaScript | |
- | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
proposal-shadowrealm
-
Updates from the 98th TC39 meeting
ShadowRealm: ECMAScript Proposal, specs, and reference implementation for Realms [Stage 3 -> 2].
-
Should you use jest as a testing library?
You can't out of the box. There is an open issue on the Node.js repositoryto let the node:vm module to use the vm's context, but it is still open. It seems that the Node.js core team is interested in fixing this problem by implementing the new ShadowRealm spec, and I think we will make some progress during 2023.
-
Building an Extension System on the Web
ShadowRealms — a successor of the Realms proposals, this API is intended for use cases exactly like plugins or extension systems, providing an option for creating distinct global environments to run the code in. While not entirely secure on its own, this API could provide a strong foundation to build actual extension systems on the Web. That said, 4 years later, the TC39 proposal is currently only at stage 3, not implemented by any browser;
-
Vitest vs Jest benchmarks on a 5 year old real work SPA
With --no-isolate it was 2.8x faster than vitest and 1.7x faster than Jest, but 19 tests failed (see table above). Some people report issues with watch mode when using --no-isolate. So I decided to not pursue it any further. Once the vm module that Vitest relies on supports ESM, or when the amazingly named Shadow Realms are added to JavaScript, we will likely get this performance boost for free without the downsides.
-
Improving Vitest Performance
If ShadowRealms are ever added to EcmaScript (and implemented into V8/Node) they'll allow for a different approach to isolating code that would be faster without the downsides of sharing global.
- Virtualization is not an important enough use case for the web platform to tradeoff ergonomics and possible confusion for web devs, who by and large […] do not understand the separation between the specs. More to the point, they really shouldn't need to.
-
Is there an npm package for perchance?
Eventually I will get around to creating a "proper" package by just grabbing all the JS that is loaded by the code in the iframe, and bundling it up. We really need the ShadowRealm proposal to go through because the perchance engine messes with a lot of JS internals, so it would mess up the rest of your app. Could do it in a WebWorker, but then everything would have to be async.
-
Show HN: Run unsafe user generated JavaScript in the browser
The upcoming JavaScript Shadow Realms proposal looks like it solves a similar problem: https://github.com/tc39/proposal-shadowrealm/blob/main/expla...
- Named Element IDs Can Be Referenced as JavaScript Globals
-
Running user code in the browser (for a leetcode clone)
Browser-based JavaScript doesn't yet have a way to isolate code fully in this manner though there is a new JavaScript feature on the way that would provide this capability. Its called ShadowRealm and would basically give you a new global context to execute code that's completely separate from your main document code.
SES-shim
-
Malicious libraries can steal all your application secrets in Elixir
I used E in the 90s: http://erights.org/
I haven't kept up with newer systems but I've heard of https://github.com/endojs/endo and just came across http://reports-archive.adm.cs.cmu.edu/anon/home/anon/isr2017... (which says "in the style of the E programming language" -- that's as far as I've read) while looking that up.
WebAssembly was designed to follow the same capability security principles. CHERI too as someone else just brought up.
-
Building an Extension System on the Web
There are other potential solutions I haven’t explored close enough (like Endo and SES), or completely omitted as they’re based on an imperfect blacklist-based approach to security (like sandboxed WebWorkers). However, the mentioned 4 solutions are the top contenders, at least in my mind.
-
Harvesting credit card numbers and passwords from your site
I don't know why you are being silently downvoted, as I think it is worth talking about the potential of using static analysis to improve things.
One promising approach is Endo[0] which "uses LavaMoat to automatically generate reviewable policies that determine what capabilities will be distributed to third party dependencies."
[0] https://github.com/endojs/endo
-
Show HN: Run unsafe user generated JavaScript in the browser
Agoric moved forward and Realms gave way to SES
https://github.com/endojs/endo/tree/master/packages/ses
And Endo is a set of tools (being) built around it to make it more practical for particular usecases
-
Deno 1.26
Yea you could restrict the app by whitelisting only the network services and folders that it will use and that's pretty valuable though at least on Linux could already easily be achieved otherwise. It's good that Deno makes it easy but let's be honest, most people will just pass -A.
I'd love to see a permissions system on a library basis. It would ask the first time a dependency is added and when a new permission is requested after an update. Javascript doesn't make that easy though by being so dynamic. SES could maybe help: https://github.com/endojs/endo/blob/master/packages/ses/READ...
-
Node runtime that sandboxes all NPM dependencies by default
I was poking around on the internet a bit earlier and I found this project. It looks pretty cool, and I figured perhaps a few of y'all might find it cool too!
I have no idea if it actually sandboxes networking by default. This other project, endo[0], seems to add some of that functionality.
Regardless of the maturity though, it makes me excited to see this type of work getting done now!
(What made me want to research it was this[1] thread from the other day.)
0: https://github.com/endojs/endo
1: https://news.ycombinator.com/item?id=30215212
-
Open source maintainer pulls the plug on NPM packages colors and faker, now what
Fortunately the problem could become more tractable if something like SES / Endo takes off:
"Endo protects program integrity both in-process and in distributed systems. SES protects local integrity, defending an application against supply chain attacks: hacks that enter through upgrades to third-party dependencies. Endo does this by encouraging the Principle of Least Authority. ... Endo uses LavaMoat to automatically generate reviewable policies that determine what capabilities will be distributed to third party dependencies."
https://github.com/endojs/endo
- Is metamask running on JavaScript?
- Embedded malware in RC (NPM package)
-
Researcher hacks over 35 tech firms in novel supply chain attack
Yeah. JavaScript is probably the closest to being there (with things like SES[0], LavaMoat[1], etc.) but we're not quite there yet. It's just shocking that this sort of thing is as seemingly obscure as it is; it's like the whole industry has collectively thrown up their hands and said code execution is unavoidably radioactively dangerous. (While simultaneously using package managers that... well.) But it doesn't have to be!
[0] https://github.com/Agoric/ses-shim
[1] https://github.com/LavaMoat/LavaMoat
What are some alternatives?
wtfjs - 🤪 A list of funny and tricky JavaScript examples
rfcs - Public change requests/proposals & ideation
Pentive - Collaborative Spaced Repetition
Swift Argument Parser - Straightforward, type-safe argument parsing for Swift
vm2-process - Execute unsafe javascript code in a sandbox
GHSA-g2q5-5433-rhrf
vrite - Open-source developer content platform
colors.js - get colors in your node.js console
caja - Caja is a tool for safely embedding third party HTML, CSS and JavaScript in your website.
sandworm-guard-js - Easy auditing & sandboxing for your JavaScript dependencies 🪱
LavaMoat - tools for sandboxing your dependency graph