| ▲ | YuechenLi 6 hours ago |
| This seems to be primarily a problem with NPM, since it's the only package manager that I know of that allows for package authors to essentially run arbitrary post-install scripts silently package install. Shai Hulud/Mini Shai Hulud happened because of this obvious glaring hole in the system, they even had the script to download an official copy of Bun to spread itself in case the targeted machine has hardened their security. So, the real question is not what other security features does a package manager need, it should be: why does a package manager have the ability to let package authors run arbitrary scripts silently on other people's computer in the first place? It doesn't really matter how good your security system is if the front door is left wide open for anyone to walk through. |
|
| ▲ | rjsw an hour ago | parent | next [-] |
| Ruby gems can run anything at install time. I know of some that download C sources from github and compile them as part of the install (not build) process. |
|
| ▲ | nightfly 5 hours ago | parent | prev | next [-] |
| > since it's the only package manager that I know of that allows for package authors to essentially run arbitrary post-install scripts silently package install Are you sure? I'm pretty sure .deb and .rpm packages both allow that |
| |
| ▲ | YuechenLi 4 hours ago | parent | next [-] | | >Are you sure? I'm pretty sure .deb and .rpm packages both allow that
Learned something new today. Thanks. I think the other significant issue with the NPM ecosystem that makes it bad in particular is NPM's dependency management is genuinely the worst out of any package manager because of phantom dependency is the default: you can be using a package without ever knowing that you are using it because it is imported implicitly, and the JS ecosystem dependency is so weird that taking down a small package that that a major project depends on cripples the entire JS ecosystem, as shown in left-pad, and launching a cyberattack via npm can be as easy as putting malicious code in any small package that large, popular packages depend on and watch it propagate. This is not hypothetical, it has been done, repeatedly in fact, over the years. TS is a good programming language, however NPM is a security nightmare, and somehow the collective reaction of everyone depends on the JS/TS ecosystem seems like a shrug and "oh well, what can you do". | | |
| ▲ | captn3m0 4 hours ago | parent [-] | | Package-level hooks are everywhere: https://github.com/ecosyste-ms/package-manager-hooks I wrote this in response to the recent AUR attacks. The problem isn’t really too many dependencies - it is that most users cannot be auditing everything they install and we need mechanisms that help users where they are. I audit my AUR pkg builds, and I would have likely caught any malware. But so would a Dependency Cooldown or a third-party threat feed. Package Managers should make it easy to build this tooling via hooks. |
| |
| ▲ | tetha 5 hours ago | parent | prev [-] | | Both certainly do. My own hypothesis on why this isn't a more widespread problem is the speed, or lack thereof, of these ecosystems. By the time a package hits debian stable, it's usually been under scrutiny for a year or more. |
|
|
| ▲ | captn3m0 5 hours ago | parent | prev | next [-] |
| (Author here). It isn’t a matter of pre-install hooks. I don’t want known malware on my system irrespective of whether it runs at install-time or not. Pre-install hooks are going away in NPM, but we will have code injected in index.js next. Modern package managers are not amenable to letting another script override its resolutions, and that is what needs fixing. |
|
| ▲ | jiehong 6 hours ago | parent | prev | next [-] |
| I agree with your premise. I’d even say perhaps we need a fine grained permission system like Apple provides, but for clis, not just something limited to maintainers of package managers. |
| |
| ▲ | sysguest 5 hours ago | parent [-] | | > perhaps we need a fine grained permission system like Apple provides, but for clis well deno has the stuff... but deno's not popular (yet) |
|
|
| ▲ | TZubiri 5 hours ago | parent | prev [-] |
| pypi/pip are also being hit by a supply chain epidemic. |