Live data from Hacker News

Shai-Hulud Returns: Over 300 NPM Packages Infected

helixguard.ai

471–480 of 797 posts

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#471
post #457

Earlier quoted context omitted.

> if I am going to run some code from somewhere and I haven't read it, it goes in a container How does this work? Every single npm package has tons of dependency tree nodes

Everything runs in the container and cannot escape it. Its like a sandbox. You have to make sure you're not putting any secrets in the container environment.

>You have to make sure you're not putting any secrets in the container environment.

How does this work exactly? containers still need env vars and access to databases and cloud environments. Without these the container is just useless isolated pod.

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#473
post #278
post #4

co-founder of PostHog here. We were a victim of this attack. We had a bunch of packages published a couple of hours ago. The main packages/versions affected were: - posthog-node 4.18.1, 5.13.3 and 5.11.3 - posthog-js 1.297.3 - posthog-react-native 4.11.1 - posthog-docusaurus 2.0.6 We've rotated keys and passwords, unpublished all affected packages and have pushed new versions, so make sure you're on the latest versio…

You're probably already planning this, but please setup an alarm to fire off if a new package release is published that is not correlated with a CI/CD run.

This is built in NPM. You can get an email on every pkg publishing.

Sure, it might be a little bit of noise, but if you get a notice @ 3am of an unexpected publishing, you can jump on unpublishing it.

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#474

Earlier quoted context omitted.

Requests is a great example of my point, actually. Creating a brand-new Python venv and running `uv add requests` tells me that a total of 5 packages were added. By contrast, creating a new Rust project and running `cargo add reqwest` (which is morally equivalent to Python's `requests`) results in adding 160 packages, literally 30x as many. I don't think languages should try to include _everything_ in their stdlib, a…

IMHO, the ideal for package management in a programming language ecosystem might recognise multiple levels of “standardisation”. At the top, you have the true standard library for the language. This has very strong stability guarantees. Its purpose is twofold: to provide universal implementations of essentials and to define standard/baseline interfaces for common needs like abstract data types, relational databases,…

Or maybe just get comfortable with adding versions and deprecation. eg optparse to argparse (though tbf, I would have just preferred it was optparse2). Or maybe the problem is excessive stability commitments. I think I prefer languages that realize things can improve and are willing to say if you want to run 10 year old code, use a 10 year old compiler/runtime.

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#475

Earlier quoted context omitted.

Because updates don't just include new features but also bug and security fixes. As always, it probably depends on the context how relevant this is to you. I agree that cooldown is a good idea though.

> Because updates don't just include new features but also bug and security fixes. This practice needs to change, although it will be almost impossible to get a whole ecosystem to adopt. You shouldn’t have to take new features (and associated new problems) just to get bug fixes and security updates. They should be offered in parallel. We need to get comfortable again with parallel maintenance branches for each major…

Are you just referring to backporting?

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#476
post #353

Earlier quoted context omitted.

> It's not "node" or "Javascript" the problem, it's this convenient packaging model. That and the package runtime runs with all the same privileges and capabilities as the thing you're building, which is pretty insane when you think about it. Why should npm know anything outside of the project root even exists, or be given the full set of environment variables without so much as a deny list, let alone an allow list?…

pnpm (maybe yarn too?) requires explicit allowlisting of build scripts, hopefully npm will do the same eventually > security model yep, some kind of seccomp or other kind of permission system for modules would help a lot. (eg. if the 3rd party library is parsing something and its API only requires a Buffer as input and returns some object then it could be marked "pure", if it supports logging then that could be also…

Deno also requires allowlisting npm scripts. It also has a deeper permissions model in general.

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#477

Perhaps 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.

pnpm

   minimumReleaseAge: 43200

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#478
post #7

Earlier quoted context omitted.

It's not "node" or "Javascript" the problem, it's this convenient packaging model. This is gonna ruffle some feathers, but it's only a matter of time until it'll happen on the Rust ecosystem which loves to depend on a billion subpackages, and it won't be fault of the language itself. The more I think about it, the more I believe that C, C++ or Odin's decision not to have a convenient package manager that fosters a ca…

I hate to be the guy saying AI will solve it, but this is a case where AI can help. I think in the next couple of years we’ll see people writing small functions with Claude/codex/whatever instead of pulling in a dependency. We might or might not like the quality of software we see, but it will be more resistant to supply chain attacks.

I don’t think I’ll live long enough to trust AI coding assistants with something like schema validation, just to name one thing I use dependencies for.

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#479
post #471
post #457

Earlier quoted context omitted.

Everything runs in the container and cannot escape it. Its like a sandbox. You have to make sure you're not putting any secrets in the container environment.

>You have to make sure you're not putting any secrets in the container environment. How does this work exactly? containers still need env vars and access to databases and cloud environments. Without these the container is just useless isolated pod.

Maybe don't use JavaScript on the backend.

Re: Shai-Hulud Returns: Over 300 NPM Packages Infected

#480
post #221

Earlier quoted context omitted.

There are companies like Helix Guard scanning registries. They advertise static analysis / LLM analysis, but honeypot instances can also install packages & detect certain files like cloud configs being accessed

But relying on the goodwill of commercial sec vendors is it's own infrastructure risk.

You can also pay a commercial sec vendor if you don't want to rely on their goodwill.
Post reply on HN