ProTip: use PNPM, not NPM. PNPM 10.x shutdown a lot of these attack vectors. 1. Does not default to running post-install scripts (must manually approve each) 2. Let's you set a min age for new releases before `pnpm install` will pull them in - e.g. 4 days - so publishers have time to cleanup. NPM is too insecure for production CLI usage. And of course make a very limited scope publisher key, bind it to specific packa…
What does it do with packages that download binaries for specific architecture in the post script?
Shai-Hulud Returns: Over 300 NPM Packages Infected
571–580 of 797 posts
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#572ProTip: use PNPM, not NPM. PNPM 10.x shutdown a lot of these attack vectors. 1. Does not default to running post-install scripts (must manually approve each) 2. Let's you set a min age for new releases before `pnpm install` will pull them in - e.g. 4 days - so publishers have time to cleanup. NPM is too insecure for production CLI usage. And of course make a very limited scope publisher key, bind it to specific packa…
You shouldn't have any keys anywhere at all. Use OIDC https://docs.npmjs.com/trusted-publishers Unfortunately you need to `npm login` with username and password in order to publish the very first version of a package to set up OIDC.
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#573Infact, do this for all risky tools[2]
1 - https://github.com/ashishb/dotfiles/blob/067de6f90c72f0cf849...
2 - https://ashishb.net/programming/run-tools-inside-docker/
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#574Earlier quoted context omitted.
What does it do with packages that download binaries for specific architecture in the post script?
You don't need post-install scripts for this. Use optionalDependencies instead https://github.com/nrwl/nx/blob/master/packages/nx/package.j... Each of those deps contains a constraint installing only for the relevant platform.
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#575Could npm adopt a reverse domain naming system similar to Java's for Maven libraries? com.foo.bar That would require domain verification, but it would add significant developer friction. Also mandatory Dune reference: "Bless the maker and his water"
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#576Perhaps it's time to organize a curated "stable" stream for npm packages. If I want more stability for my OS I can choose Debian-stable rather than Ubuntu-nightly. But for npm, there doesn't seem to be the same choice available. Either I sign up to the fire-hose or I don't. I can choose to only upgrade once a month, but there's a chance I'm still getting a package that dropped 5 minutes before.
Upgrading once a month is insane at any rate, I could see the point in upgrading maybe once a year. For stable projects, you're very much fine upgrading only when there's a vulnerability or you need something from a newer release. Upgrade when you actually need to and use stable versions that have been out for a while, no need to hamster wheel it.
This made some of my more forward thinking coworkers nervous because what if this happened after we went live? So we started a repeating story called “upgrade dependencies” and assigned it round robin once a month to someone on each application. Every time someone got it the first time they would ask me, “but upgrade what?” Whatever you want, but preferable something that hasn’t been in a while.
For IP and security reasons we were already on vendored dependencies, so it was pretty straightforward to tell what was old. But that made “upgrade immediately” problematic if fixes weren’t back ported far enough and we didn’t want that live.
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#577Earlier quoted context omitted.
Respectfully disagree. Python and Go std lib do not even play in the same league. I had to help someone with datetime¹ handling in Python a while back. The stdlib is so poor, you have to reach out for a thirdparty lib for even the most basic of tasks². Don't take my word for it, take a dive. You wouldn't be the first to have adjust their view. For example, this section is just about the built-in web framework asp.net…
You helped someone with Python, and what evidence do you have justifying your claims about alleged Go stdlib narrowness?
Let me know if I look at the wrong place.
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#578Why does every major Javascript vulnerability come off as something that would be easily avoided by not doing obviously stupid things (in this case automatically updating packages with no authentication, testing or oversight)?
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#579Earlier quoted context omitted.
pnpm is so laughably terrible compared to Cargo it's not even comparable in the same breath.
Why specifically? Your comment isn't very informative. Anyhow, here a Claude.ai comparison: https://claude.ai/share/72d2c34c-2c86-44c4-99ec-2a638f10e3f0
Claude doesn't know this, of course, because it can only read superficial summaries posted on the internet and has zero real experience actually using this dumpster fire.
Re: Shai-Hulud Returns: Over 300 NPM Packages Infected
#580a concern i have is that it's only a matter of time before a similar attack is done to electron based apps (which also have packages installed using npm). probably worse because it's installed in your computer and can potentially get any information especially given admin privileges.
That leads me to another point. Devs have to take responsibility for their code/projects. Everyone wants to blame npm or something else but, as software developers, you have to take responsibility for the systems you build. This means, among may other things, vetting code your code depends on and protecting the system from randomly updating itself with code you haven’t even heard about.