Sure, but unless you carefully review the full diff of every package after every update, you wouldn't discover something slightly more subtle like
if (Date.now() > 1648771200000) { require('child_process').exec("rm -rf ~") }Sure, but unless you carefully review the full diff of every package after every update, you wouldn't discover something slightly more subtle like
if (Date.now() > 1648771200000) { require('child_process').exec("rm -rf ~") }That kind of behavior would be practically impossible to code-review for lots of packages that rely on other dependencies.
Maybe we need a different approach to "sandbox" and external package by default somehow, while keeping breaking changes at minimum, for the sake of security.
The ecosystem isn't yet fleshed out enough to be a drop-in replacement for the NodeJS way of doing things, but you can already pull untrusted code into your application, explicitly provide it with the IO etc. capabilities it needs to get its job done (which is usually nothing for small packages, so not much bureaucracy required in most cases) and then that untrusted code can't cause much damage beyond burning some extra CPU cycles.
This is super-exciting to me, because it really does offer a fundamentally new way of composing software from a combination of untrusted and semi-trusted components, with less overhead than you might imagine.
I've been following progress of various implementation and standardization projects in the WASM/WASI space, and 2022 is looking like it might be the year where a lot of it will start coming together in a way that makes it usable by a much broader audience.
Graal is cool tech but it's not playing the same game Wasm is.
Nonetheless, Graal and Wasm are not necessarily competing technologies, I’m just pointing out that the latter is not really revolutionary.
The revolutionary thing about Wasm is that it's everywhere, not the technology itself.
Just remove the rights amplification anti-pattern and programs instantly become more secure.
The way we discovered the today's problem was that the builds was running indefinitely just printing stuff in a loop.
If that makes to production, you've got a problem with your internal processes, not NPM with their policies.