Re:Zed Editor automatically downloads binaries and NPM packa...
by broeng on Monday July 08, 2024 @03:27AM
(#40903316)
Why the hell does npm support a postinstall script? There really shouldn't be a need to run arbitrary code provided by the package for something like this.
Re:Zed Editor automatically downloads binaries and NPM packa...
by ErikBjare on Monday July 08, 2024 @04:13AM
(#40903525)
[delayed]
Re:Zed Editor automatically downloads binaries and NPM packa...
by broeng on Monday July 08, 2024 @05:49AM
(#40904026)
I don't really think thats more obvious. It's expected to install dev libraries, not system services, it shouldn't have that need.
Re:Zed Editor automatically downloads binaries and NPM packa...
by andyferris on Monday July 08, 2024 @06:17AM
(#40904123)
NodeJS isn't very sandboxed. Many "dev libraries" are native and will either download and link to binary blobs, or build e.g. C code, which AFAICT is what all the various install scripts are for.
Re:Zed Editor automatically downloads binaries and NPM packa...
by broeng on Monday July 08, 2024 @08:48AM
(#40904939)
It seems like a bad design choice, that, besides allowing for running untrusted code directly at download time, also makes it difficult to properly mirror artifacts, and I'd assume, make platform portability inconsistent, at best.
Re:Zed Editor automatically downloads binaries and NPM packa...
by deafpolygon on Monday July 08, 2024 @05:59AM
(#40904052)
dependency checking isn't simple
Re:Zed Editor automatically downloads binaries and NPM packa...
by nijave on Monday July 08, 2024 @07:17AM
(#40904373)
The package itself is arbitrary code. You're running arbitrary code either way whether it's preinstall, install, post install, or when the package code gets ran.
It's common to need to setup tool chains for code that gets compiled (i.e. a node module that adds language bindings to a C library)
Re:Zed Editor automatically downloads binaries and NPM packa...
by nijave on Monday July 08, 2024 @07:15AM
(#40904364)
>someone sends a dev at some company, or even a freelancer, some code
The code itself could be malicious and have backdoors. Really you shouldn't run anything untrusted outside a sandbox or some other form of isolation
Re:Zed Editor automatically downloads binaries and NPM packa...
by alfiedotwtf on Monday July 08, 2024 @08:01AM
(#40904595)
How is that any different from the VS Code extensions that have one star and are just copies of other extensions… waiting to get high stars and then switch-a-roo? Same goes for browser extensions.
Unless you’re auditing everything while taking Trusting Trust into account, you’re drawing the line somewhere saying “ok I can’t be bothered past this point verifying”.
… everyone has a line somewhere on the trust-but-verify spectrum
Re:Zed Editor automatically downloads binaries and NPM packa...
by wtetzner on Wednesday July 10, 2024 @05:41PM
(#40931804)
> … everyone has a line somewhere on the trust-but-verify spectrum
Sure, and by making the automatic downloads optional, users are given the choice of where they want to draw that line.
Here's an idea: someone sends a dev at some company, or even a freelancer, some code. Code references a module with a malicious npm package (say, with a postinstall script). Dev opens it in zed
Now, my untrusted code is running on your machine, probably without your knowledge