Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

57% Positive

Analyzed from 9733 words in the discussion.

Trending Topics

#npm#package#security#packages#https#docker#code#more#run#should

Discussion (300 Comments)Read Original on HackerNews

tomxor1 day ago
At this point lifecycle script should be disabled by default in NPM.

It's a convenience feature that provides built-in Arbitrary Code Execution (even for transient dependencies), and every one of these widespread NPM worm style attacks has propagated through it, because of the default setting. Also enabling it for one command shouldn't automatically permit all transient dependencies to run lifecycle scripts, it should be required to explicitly mark each dependency to limit it to where it's absolutely necessary.

The vast majority of NPM packages do not depend on these scripts, and you should disable them globally if you haven't already.

bakkoting1 day ago
There's an RFC for this: https://github.com/npm/rfcs/pull/868
hirako20001 day ago
Or simply use pnpm.
tomxor1 day ago
That's helpful to prevent individual secret harvesting, however it does not protect you from potential silent downstream effects in packages. i.e. inclusion of malicious code in libraries you depend on, this could be as simple as inserting a cryptominer, or as severe as data exfil in a front end package.

This default can affect all consumers of NPM packages, regardless of whether you use yarn, pnpm or npm itself, because most package maintainers use NPM. This is why it's NPM's responsibility to change this default in order to prevent spread of malware in packages.

josephgabout 23 hours ago
Yeah. Or they should run in a sandbox. I would have no problem with a post install script which ran arbitrary commands in the context of the installed package itself. But arbitrary scripts + user level permissions is a recipe for disaster.

That said, packages could still just run whatever junk they want when they first get imported in a program.

nepthar1 day ago
“No way to prevent this” says only package manager where this regularly happens.
downrightmikeabout 23 hours ago
OWNED BY MICROSOFT
bakugo1 day ago
Is there anything about npm that makes it particularly susceptible to these attacks, other than the fact that it's the most popular package manager of all?
kommunicate1 day ago
npm can execute code after install and most package managers don't do that
joshkel1 day ago
I'm far from an expert, but this feels like an oversimplification.

Python packages traditionally use setup.py to install code, and setup.py is all executable code under the installed package's control.

Native Ruby Gems execute arbitrary code via extconf.rb.

Pre .NET Core, NuGet packages could ship scripts like `install.ps1`. That's been removed, but they can still ship `.targets` and `.props` files that are incorporated into your build (and so can run code at build time).

PHP Composer packages can ship install scripts or configure themselves as Composer plugins.

The venerable .tar.gz approach to packaging, covering decades of C and C++ code, is all about executing code during installation.

There are measures that can help (e.g., PHP Composer doesn't run install scripts of _transitive_ dependencies) but the JS space is adopting measures that can help too (like pnpm's approve-builds).

Rantenki1 day ago
/me looks at the `build.rs` file in my Rust's project's `Cargo.toml` and laughs nervously...

(For non Rustaceans: "Placing a file named build.rs in the root of a package will cause Cargo to compile that script and execute it just before building the package.")

staticassertion1 day ago
Most of them definitely let you do that.
megousabout 23 hours ago
You're installing code from npm anyway, presumably to execute it at some point on some machine. If it's will be executed from an install script or later during app execution should not really make much of a difference for most devs.
freakynit1 day ago
Yep.

1. Every day there's a new package.

2. Then five more packages appear so you don't have to write that one terrifying line of JavaScript yourself.

3. Then someone writes a wrapper around those five packages.

4. Then someone writes a "modern, lightweight, zero-config" wrapper around the wrapper.

5. Then a framework adopts it, a build tool requires it, and suddenly your todo app has a dependency graph that looks like international diplomacy.

6. Out of 100 devs building the same product, there are now 300 different dependency combinations, all somehow involving 'left-pad' spiritually if not literally.

7. Half the packages are maintained by one person, unpaid, at 2 a.m., after getting yelled at in GitHub issues.

8. The other half were abandoned three years ago but still have 40 million weekly downloads because removing them would break civilization.

9. Pinning dependencies sounds nice until the ecosystem tells you, "sorry, this package only works with Node 22, this plugin needs Node 18, and this transitive dependency has discovered ESM enlightenment."

10. So everyone lives on the bleeding edge, except nobody agrees where the edge is, and the bleeding part is very real.

So yeah, npm is not uniquely cursed because JavaScript devs are worse. It's cursed because it turned code reuse into a lifestyle, dependency trees into rainforests, and 'npm install' into an act of faith.

MadnessASAP1 day ago
> 7. Half the packages are maintained by one person, unpaid, at 2 a.m., after getting yelled at in GitHub issues.

By a manager for for a >$1 billion market cap corporation who doesnt understand that the one person isnt an employee.

Hammershaftabout 23 hours ago
Pangram says this comment is %100 LLM generated.

It certainly reads as LLM generated!

btown1 day ago
At a certain point, is it better to just turn off Dependabot and freeze all NPM packages (minor/patch version and all), rather than continuously update? Particularly for frontend packages, meaningful security fixes seem less likely than supply chain attacks these days.

It's a sad state of affairs, for sure - but is there a reason we can't just switch our frontends to static BOMs, and trust that NPM at least gets their "you can't republish to an old version" bare-minimum constraint right?

Sohcahtoa821 day ago
> At a certain point, is it better to just turn off Dependabot and freeze all NPM packages (minor/patch version and all), rather than continuously update?

But then the compliance team gets annoyed because some CVE with a CVSS score of 3.1 that has a patch available sits unfixed.

btown1 day ago
I wonder if the only thing that will solve this is an insurer or regulator saying that: "A system that automatically pulls updates for dependencies without human review, where said updates are not protected by multi-factor authentication by their respective maintainers, shall not be considered secure."

That would wake NPM up at least to the notion that it's absolutely reasonable to require OSS maintainers to press a button on their phones when releases go out, and that's a good thing not a bad thing.

DeliciousSeaCow1 day ago
Pretty much what the EU Cyber Resiliency Act says re: OSS due diligence, actually.
lovich1 day ago
The core problem is companies skimping on maintenance.

They don’t want to pay engineers to do the analysis manually, and they don’t want to pay for someone to figure out a better automated system.

Would anyone be surprised at their car having problems if they cheaped out on oil changes?

tedd4u1 day ago
Enforce a “seasoning” period, for example don’t let any pull pull versions newer that 30 days. Perhaps with an exception for versions that address known CVEs.
peterldowns1 day ago
Yes. This is partially why other ecosystems don’t see as many supply chain attacks.
zahlman1 day ago
> and trust that NPM at least gets their "you can't republish to an old version" bare-minimum constraint right?

... Does NPM not create full lockfiles, with hashes and pinned transitive dependencies and everything?

btown1 day ago
Yes, and the problem here is that most projects have automated systems that automatically update those lockfiles on every upstream release of a library, under an assumption that minor releases are either security patches or bugfixes that would immediately be useful to the consuming project.

IMO this is built on a pre-ShaiHulud, pre-AI set of assumptions, and should be evaluated from first principles with today's security situation.

zahlmanabout 8 hours ago
My point was the "with hashes" part. You aren't in fact "trusting" NPM to ensure that old versions aren't replaced if the package installer is verifying the hash.
mentalgear1 day ago
The situation is getting crazy ... personally I have already uninstalled node, python and all package managers from my machine and instead only use them in devcontainers / VMs.

But even if the dev community comes up with super hardened security, I fear in at least a year the models will be good enough in social engineering that we are still running a losing game.

zahlman1 day ago
> the models will be good enough in social engineering

Never mind questions of how good the models will/can get. I'm confused why people expect that, in principle, models getting really good at social engineering would have such huge impact. Seems to me like it has diminishing returns and is severely bottlenecked by the fact that the target operates at human speed.

The amount of effort involved in the XZ hack, for example, was immense, and it couldn't have been accelerated because it worked specifically by wearing the existing maintainer down over time. You could generate and send all the necessary nastygrams in seconds and it wouldn't speed up the human consuming them (and in fact, having all of them arrive at once would raise suspicion).

And there is a limit to how persuasive that input can be. Take any of the random nastygrams directed at the XZ maintainer; maybe they could have been made more nasty, more pointed, more aware of the maintainer's personal weaknesses and fears — but would that have actually been overall more effective? I think not, or at most only a tiny bit.

Terr_1 day ago
I'm imagining an influence campaign where someone weaponizes targeted advertising and recommendation engines against Mr. Trusted Maintainer, so that it's a The Truman Show effect, where the background of their entire digital bubble pushing the idea that they need retire and delegate.
pyinstallwoesabout 22 hours ago
This definitely happens. Perhaps more on a state actor level of sophistication but yeah. I’ve seen it. It’s wild.
wolfi11 day ago
how do containers solve the problem? if they are connected to the internet (and they are) you have got the same problem, if the credentials can be read by the container, at least to my understanding
CGamesPlay1 day ago
Things on my workstation that the container does not have access to: browser cookies, 1Password cli, SSH keys (even if I allow the SSH agent socket), cargo publish tokens (unless it’s a rust project), npm tokens (unless it’s an npm project), and not to mention anything relating to my other clients (don’t compromise my employer when I vibe install some dep for a random side project).
jcgl1 day ago
On my personal machine, I run OpenSnitch. Much better defense against data exfil if you reject outbound connections to unexpected/unwanted hosts.
pingou1 day ago
That wouldn't help in that case as exfiltrated data is committed to public GitHub repositories. Unless you have to accept every time an app posts or requests data from known hosts?
mentalgear1 day ago
For credential stealing, that is true, but at least it would protect your local machine. But I just read these worms also try container escape ...
silon421 day ago
We need to prevent direct connections to internet for containers... once you have a proxy, predefined credentials (api keys) can maybe be added there (per container/target).
fnoef1 day ago
You need to use full isolated VM with its own kernel. But then again, I've read somewhere that this malware is also trying to escape the VM isolation as well...
TacticalCoder1 day ago
Watertight subdivision in a ship doesn't promise: "there'll never ever be water in this ship". It says: "If there's water in this ship due to one hole, it'll stay in one compartment". Note that I said one hole: you have the titanic, many compartment gets holes, that one ship is still going to sink.

(btw that the Titanic sunk is not an excuse not to secure other ships. And it did save a great many other ships to have watertight subdivision.)

So... Although there are exploits escaping containers and VMs and then bad guys doing lateral moves across machines, you still want defense in depth.

sitkack1 day ago
One thing could be more clear, is that the Titanic's bulkheads didn't go all the way to the top deck. They did not seal completely and were not watertight.
HWR_141 day ago
Without node, how do you control your cloud resources? Cloudflare requires wrangler. AWS has a lot of node clis. Etc.
anygivnthursday1 day ago
From CI pipelines with pinned package versions and OIDC instead of permanent secrets limited, least privileges.
rubiquity1 day ago
AWS has CLIs and SDKs in many languages.
mrgoldenbrown1 day ago
I want to go all in on zed now that it's 1.0 but it's security model is all or nothing AFAIK - either I allow it to download and install unknown to me NPM packages whenever it wants with no notice to me, or I turn off all LSP functionality. And then I keep seeing news like this.
HALtheWiseabout 3 hours ago
I wonder if npm could run a program where package uploads are automatically delayed for ~10min while they get distributed to an ecosystem of third-party code auditing companies for automatic checks. You could have a public leaderboard of which auditors detect problems fastest and most reliably, or even monetary compensation.
urbandw311er1 day ago
This list is incomplete - at least one other package (nx-console VS code extension; 2.2M downloads) was compromised yesterday with this worm: if suitably qualified/connected people are reading this, it could be worth following that dependency chain too in case there are more. See here:

https://github.com/nrwl/nx-console/security/advisories/GHSA-...

PS: I posted on HN to try and alert people right after it was compromised but sadly got almost no upvotes :-(

gherkinnn1 day ago
> In regards to the whole ecosystem: TC39 should take a look into adding a better standard library to JS itself, which would reduce the amount of one-liner packages.

I concur, the best part of working with Deno way back was its standard library [0] and overall complete dev environment. It is just so damn obvious that a runtime comes with an integrated test runner and assertion library.

0 - https://docs.deno.com/runtime/reference/std/

WorldMaker1 day ago
To be fair, Node has `node:test` [0] and `node:assert/strict` [1] modules out of the box for several LTS versions now. `node --test` can easily replace Mocha and `node:assert/strict` is fine, but `chai` is still sometimes nicer (include ergonomics like `expect`). (Deno's @std includes an `expect` style assertion library.)

Of course, the trouble is that there are so many test runners in the Node ecosystem and many of them cannot be as easily replaced as Mocha, so the shift to the out-of-the-box test harness and assertion library will of course be painfully slow. People like the over-complicated nature of both Jest and Vitest for all sorts of reasons. Major companies thought Karma was a good idea. (I still don't understand why more developers didn't cringe at "Yo dog, I heard you like V8 for your unit tests, so we're gonna spin up a second, different copy of V8 from your existing V8 environment.")

[0] https://nodejs.org/api/test.html

[1] https://nodejs.org/api/assert.html#strict-assertion-mode

gherkinnn1 day ago
Much came after Deno added them. I don't know what will happen to Deno, but I am glad they showed the Node world than life can be a little more pleasant
tln1 day ago
I'm not sure any of the packages here would be part of a "better standard library".

Do any language standard libraries have a "3 hours ago" formatter? Thats what timeago.js does

Maybe slice.js, which just does python-style indexing with negative numbers. TC39 already made array.at() and array.slice() handle negative numbers.

WorldMaker1 day ago
> Do any language standard libraries have a "3 hours ago" formatter? Thats what timeago.js does

There's also a platform feature for that now: Intl.RelativeTimeFormat: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

It asks you to do the basic time math to determine your granularity so there's still a role for a library, but also that time math gets easier with Temporal: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

(Specifically `Temporal.Now.instant().since(somePastInstant)` returns a Temporal.Duration that you can relatively easily determine the highest granularity you want and pass that to an Intl.RelativeTimeFormat instance. Also Intl.DurationFormat which is what a Temporal.Duration's `toLocaleString()` uses may also be good enough in many "x hours ago" type situations, though it is over-precise for them.)

tln1 day ago
Thanks for that!

So, back to the GP post - TC39 should make a bigger stdlib.

Lets say timeago.js is warranted (as a polyfill and terser API) AND TC39 is taking action.

On slice.js, TC39 took action AND usage is unwarranted since the functionality is widely available. Maybe a stride.js would be needed.

There are 2 modules where npm's culture of "tiny modules because the stdlib is impoverished" holds - but the issue isn't TC39 really. There are 312 modules that aren't related to npm's culture of "tiny modules because the stdlib is impoverished".

ireadmevs1 day ago
Worth noting that nowadays nodejs std lib keeps growing and includes the aforementioned assertion and testing support.

https://nodejs.org/api/

mentalgear1 day ago
> Docker Container Escape

> The payload checks for the Docker socket and, if present, attempts container escape through three sequential methods:

So even if you're running devcontainers / VMs, these worms are already trying to escape.

Make sure you're running a rootless VM engine (e.g. podman instead of docker) !

mapontosevenths1 day ago
Despite what some people will tell you (including many in the security indistry), Docker is not a strong security boundary, and it should not be treated as one. It shares a kernel with the running system.

It reminds me of the good old days when people would hand out low privilege Linux accounts and rely on the kernel to prevent privilige escalation. Docker is literally the same thing, just with extra steps. Especially today with new kernel LPE'S dropping every 5 minutes.

Yes, Podman is a bit better because you arent handing the attacker root, but... why hand them an account at all? Just use a grown up VM.

throw0101c1 day ago
> Despite what some people will tell you (including many in the security indistry), Docker is not a strong security boundary, and it should not be treated as one. It shares a kernel with the running system.

Solaris Zones and FreeBSD Jails (their inspiration) also share a kernel with the running system and do not seem to have as many escape vulnerabilities.

(Though partly because there may not be as much scrutiny of course.)

Icathian1 day ago
Yeah, I'm reminded of 15 years ago being told Linux was super secure because people were popping Windows all the time. Turns out it was mostly just a function of effort pointed at the target, and I don't have any reason to believe that's not the case here too.
MattCruikshank1 day ago
I've been toying with using Jart's Blink, the "tiniest x86-64-linux emulator". If it were hardened against attacks by a smart community, it seems really attractive...

Then I've been toying with using WASM, with a strictly limited API surface... (API stands for what, "Attack, Please, Infiltrators"?)

I'd really love to make a service which can run "untrusted" code... I want this to exist. I want it to feel like the Sandstorm.io marketplace, and to use Tailscale or something like it... and then to make "Facebook but only for friends or friends-of-friends." No public figures. No random people or ads in my feeds. Just friends. And then other similar apps - mail, discord, etc. Don't let it make outbound HTTP connections. Don't let it access local filesystem, other than assets that were bundled with it. Give it a SQLite API... And let it handle inbound HTTP, REST, WebSocket requests... And use gRPC over Tailscale to only talk directly to approved contacts...

Thoughts? How to run untrusted code safely?

I tried using Firecracker and gVisor... But I'm dissatisfied with them. I was trying to make it easy for someone to download and run my service... But Firecracker and gVisor don't at all feel like "libraries that install cleanly." They feel more like, if you're enterprise scale, you can hire someone to make sure Firecracker and gVisor work the way you want... Maybe I'm just not trying hard enough... Maybe using WSL2 on Windows 11 is just asking for trouble. I tried several different ways to run Linux on Windows, and none of them seemed very happy, when I tried to add Firecracker / gVisor.

corford1 day ago
We've been leaning on Lima recently for a "dockeresque" experience with hard VM guarantees. Also keeping an eye on https://github.com/containers/crun/blob/main/krun.1.md
staticassertion1 day ago
Docker is a lot more than just an unprivileged user. In particular, it comes with a seccomp filter. A lot of LPEs are blocked by that filter. Docker is actually a quite decent security boundary - in this case the attackers did not attempt to subvert docker by attacking the kernel attack surface, they attacked a weak configuration via the docker socket being mounted.

The reason you don't use a "grown up VM" is because it's significantly more difficult. Which VM? Firecracker requires KVM and a guest operating system - so how are you getting things in and out in a way that doesn't violate security? That's real work.

gVisor is great and my recommendation, certainly, but the difference between "nothing" and "docker" is actually pretty huge imo.

mapontoseventhsabout 23 hours ago
> the difference between "nothing" and "docker" is actually pretty huge

You've got me there, but it's not really saying much.

Seccomp, for example, is nice, but... It blocks ~44 system calls, and leaves 300 plus exposed. Any memory corruption issue in those remaining calls remain wide open. So better than nothing? Absolutely, but it leads to a false sense of security. I know actual security researchers that intentionally run malware inside Docker and think they're safe. They're not.

Then we can talk about docker itself. It had something like 6 public CVE's related to full escapes last year. If your patch cycle takes 30 days then you spend about half the year with a full, public, escape known. Even if you patched those all on day one you spent most of the year vulnerable to one of the many Kernel vulns that it doesn't stop. On any given calendar day it's statistically likely there is at LEAST one way to escape publicly known and unpatched.

So, yeah. It beats nothing by a huge margin, but it's WORSE than nothing if you think it's safe to run arbitrary untrusted code in. That was never what it was for, it's just what people treat it as. It's not a VM, wasn't designed to be, and people need to stop pretending it is.

pezgrande1 day ago
Only works if the Docker socket is mounted which is pretty stupid thing to do and also not something you would do in a "frontend" container. Essentially is like having a password-less ssh
zahlman1 day ago
> the good old days when people would hand out low privilege Linux accounts and rely on the kernel to prevent privilige escalation.

... Did that actually stop?

... Is that not the purpose of being able to make multiple accounts (even on a random desktop or laptop system) and restrict their privileges?

beardedwizard1 day ago
Yeah because I'd rather trade one kernel surface for another.
moebrowne1 day ago
Or don't mount the Docker socket into containers
ErroneousBosh1 day ago
Or mount it read-only if you do, like for Traefik.
cyphar1 day ago
That doesn't actually do anything, connect(2) doesn't need write access to connect to a socket. If you think about it, if that did work then a socket with read-only permissions would be basically useless -- Docker uses HTTP for its API, how would the request for "read-only data" be sent without the ability to send messages?

I wrote a comment ~8 years about this[1], I'm kinda sad people still do this and seem to misunderstand just how big of a security hole they are opening...

Just don't do it. If you absolutely must then you can configure some very restrictive AuthZ plugin (but those are incredibly fickle and are almost certainly security theatre because they are basically just an application firewall).

[1]: https://news.ycombinator.com/item?id=17983623

vsgherzi1 day ago
I really wish we would’ve gotten something more like jails or zones. Or better yet put the containers in a jail or zone. Is there a comprehensive sandbox for Linux like the bsds have?
dboreham1 day ago
Worth noting that cgroups (kernel feature underlying containers) is "something more like jails or zones". Actually it is "something exactly like jails or zones".
Havoc1 day ago
Unprivileged LXCs get pretty close. Less unified design wise but on some aspects better - kernel escape doesn’t land you on a 0 UID
zenoprax1 day ago
> "kernel escape doesn’t land you on a 0 UID"

I'm not sure I agree/understand. If you've somehow bypassed AppArmor and cgroup mechanisms then any UID/GID remapping is irrelevant. At this point you're in a position to directly manage memory.

What do you mean by "kernel escape"?

codedokode1 day ago
Namespaces look dangerous to me because they break lot of assumptions software was built on before. For example, sudo relies on /etc/sudoers being accessible only to root. But with unprivileged containers one can easily create a filesystem namespace where /etc/sudoers would contain arbitrary data. I think, SUID bit won't work in container, but there might be other ways to confuse privileged software using containers. Or not?

Also, if the container has access to dbus, one can try to exploit multiple services listening on dbus.

matheusmoreira1 day ago
Why not run a proper virtual machine?
waz0wski1 day ago
That's the direction container runtimes are trending

Amazon has been doing it with Firecracker for a while and Kata containers is another popular one

https://github.com/firecracker-microvm/firecracker

https://github.com/kata-containers/kata-containers

matheusmoreiraabout 6 hours ago
I did the same. Claude coded my own solution.

https://github.com/matheusmoreira/virtdev

It's been working really well. Use it every day. Just make some machines and ssh in.

anygivnthursday1 day ago
I think Google took a different approach with gVisor and limited userspace kernel interface, tradeoffs...
throw0101c1 day ago
> Why not run a proper virtual machine?

Extra 'overhead' and heaviness (perceived or real).

agrounds1 day ago
I dunno, why own a car when you could ride your bike instead? They’re just different things and people may choose to use one over the other for a variety of reasons.
ahknight1 day ago
The joys of running podman/docker on macOS: you can't help but run it in a hypervisor.
jeswin1 day ago
> Make sure you're running a rootless VM engine (e.g. podman instead of docker) !

Aren't most people running docker rootless (at least on Linux)? Does podman do more?

Maakuth1 day ago
The docker CLI tool is normally executed with user privileges, but there's dockerd, a daemon running as root that actually does the container execution.
jeswin1 day ago
Installing docker doesn't require root.

"Rootless mode lets you run the Docker daemon and containers as a non-root user."

https://docs.docker.com/engine/security/rootless/

This is how docker is best installed on Linux, and there's a convenience script for it as well (https://get.docker.com/rootless). I am surprised that's not how people are using docker.

cyanydeez1 day ago
im not sure people understand the security vectors. a user with docker permissions effectively has root permissions.

often, docker in docker is used to manage docker orchestration. putinng a user in a docker and peoviding docker access is security through obscurity.

on the flip side, i see people blindly installing tools and skills not understanding they are pushing context and capabilities without any significant security features.

Imagine mythos is actually exceptional hacker. if you give it a well crafted malicious prompt, its going to even more insecure.

the double edged sword is really fascinating to think about

throw0101c1 day ago
> Aren't most people running docker rootless (at least on Linux)? Does podman do more?

In the HPC space Apptainer (previously "Singularity") was created precisely due to (multi-)user-level access, especially with the use of NFS.

perlgeek1 day ago
I'd guess that most people who run Docker on linux install it through their distro's package manager, which has a dockerd running as root.

On Debian derivatives, you need some kind of extra privs to even talk to it (being a member of the "docker" group, iirc).

mayama1 day ago
docker service that sets up containers runs as root. podman does away with that service.
evertheylen1 day ago
I rely on podman for my "devcontainers": https://github.com/evertheylen/probox. If anyone can point me to the weak points in my setup I'd appreciate it!
mentalgear1 day ago
You may run

> podman info --format '{{.Host.Security.Rootless}}'

to ensure podman is rootless in your config.

cyanydeez1 day ago
i wish opencode would have a protocol that puts real guardrails around its agents. rather that gaving to try and transplant weve had ssh for decades, surely you can wire a xomms pathway that cant deciate.
wlkr1 day ago
At this point I would very much like to get off Mr Bones' Wild Ride but I fear this is going to continue to happen because, from my own exploration at least, a large number of commercial detection strategies are directed at the repo/device/developer level when loading/using a package.

This seems analogous to how we tackle email spam and general malware. It means that there is almost always a target valuable enough for bad actors to continue trying. However, unlike email (mostly...), package managers are centralised authorities (and anything out-of-band is surely the developers problem?).

My ill-informed feeling is that we might need to change the culture of lazy versioning with rapid releases and focus on stable, deeply scanned versions at registries. There will be some effect of volume and scale so I could be off, but it still seems telling that this impacts high-churn languages more often.

I don't know, I would love a comprehensive article that explores the landscape right now.

cess111 day ago
Wondering about Mr Bones' Wild Ride and suspecting it might be a reference to the 1991 movie Nothing But Trouble I took a look, and found I had remembered it wrong.

The roller coaster in that movie was called Mr Bonestripper, https://www.youtube.com/watch?v=NEZEgd8GjJc .

Instead it comes from Roller Coaster Tycoon 2, https://knowyourmeme.com/memes/mr-bones-wild-ride .

As for the comparison with spam, there we kind of settled on making people accept spam by vacuuming up their email addresses in pretty much every commercial and social computer network setting, giving it a veneer of legitimacy. I think it is likely to happen in this area too, perhaps some combination of Oracle licensing surveillance agent style software and automated dependency management, i.e. 'solving' supply chain malware by whitelisting some other malware.

breezerbottles1 day ago
There's also Mr. Toad's Wild Ride at Disney parks, https://en.wikipedia.org/wiki/Mr._Toad%27s_Wild_Ride
test12351 day ago
I always remember that reference from mallrats ... I had never thought to look up what they were actually talking about
tardedmemeabout 11 hours ago
People who were born when this meme was current are 13 years old today. Time sucks. Time really sucks.
rubnogueira1 day ago
aube (npm/yarn/pnpm drop-in alternative) now has a "jailBuilds" flag that restricts access to network/filesystem access.

https://aube.en.dev/package-manager/jailed-builds.html

But this feels like a cat/mouse game.

no-name-hereabout 14 hours ago
> aube (npm/yarn/pnpm drop-in alternative) now has a "jailBuilds" flag that restricts access to network/filesystem access.

1. It seems like the restrictions are only for lifecycle scripts, so wouldn't help if/when the package's actual code had malicious code inserted?

2. Package managers like pnpm seem to entirely block lifecycle scripts by default, so I guess this is an in-between solution.

Still, I guess it's a step in the right direction for those want or need to run lifecycle scripts specifically.

cyanydeez1 day ago
dino was wired with security in mind, but you can see developers dont tend towards aecurity
rubnogueira1 day ago
Because there is a time and effort cost to swap over to another framework/runtime even if it brings benefits, and security is always considered "good for now" unfortunately.

That is what made Bun popular, and tools like uv/pip, oxlint/eslint, orbstack/docker desktop, and the list goes on. Drop-in replacements where we get 10x with little effort.

epicide1 day ago
Because employers don't tend towards security. In fact, many actively punish somebody for "sandbagging" or simply taking too long if they even suggest a security concern.
esafakabout 23 hours ago
What is dino?
Advertisement
freakynit1 day ago
Collected all the attacks that happened in the npm ecosystem in past 1 year here:

https://npm-supply-chain-attacks-25-26.pagey.site/

kjok1 day ago
Please also collect responses from people, you'd find a pattern: a new attack is launched, people make noise, and later go back to installing packages the same way. Enterprises already use private registries to combat such attacks, vulnerable folks include individual devs and small teams.
freakynitabout 14 hours ago
Want to.. but I'll need to first integrate social-media and forum scanning in my tool. Haven't done that yet.

But, it's a good feature to have.

Thanks.. gonna integrate now :)

HDBaseTabout 15 hours ago
Did Claude generate this site?

The scroll seems to jump all over the place on my device.

freakynitabout 14 hours ago
yep... fixed it in new version. Thanks for mentioning.
Havoc1 day ago
Pretty wary of the entire JS/nodejs ecosystem at this stage.
michalsustr1 day ago
Given general software quality of the js ecosystem, the proliferation of supply chain attacks was just matter of time. I’m curious how other ecosystems will hold (eg Rust)
tadfisher1 day ago
NPM is an easy target because every package has the capability of interacting with your development environment by default, via pre/post-install scripts. Cargo has something similar with build.rs scripts, as does Cabal (Haskell).

In JVM-land, thanks to binary distribution being the default, the number of packages you can usurp to achieve the same compromise is fairly small; essentially Maven and Gradle plugins. Which is why you should be extremely wary when, say, Sentry tells you to add them as a dependency by setting up their Gradle plugin. Not sure about sbt. Clojure source dependencies can provide "prep" scripts, which are not automatically run as part of a build, but still execute code on your machine.

There's a pattern here: some build tools incorporate dependency-provided code as part of the consumer project's build, and that is a juicy attack surface. Packages which include such code, or are recently updated to include it, should be treated with extra scrutiny.

freakynit1 day ago
And now, vibe-coding is just gonna take this to a whole another level.
cozzyd1 day ago
Yes... The only things I use from the JS ecosystem are {Claude,gemini}-cli which I fear will be compromised. Fortunately I run in them in their own user accounts with no e.g. ssh credentials, but I dead that's not enough especially for Gemini which probably has access to my entire Google account somehow.
matheusmoreira1 day ago
Same. At this point I just started using virtual machines for any project that pulls in packages from outside Linux distribution repositories.
mghackerlady1 day ago
JS is a fine frontend language I guess, if you're willing to hand-roll your own code instead of using frameworks and junk. Whoever decided that JS deserves to run as a backend is an idiot who should not be trusted to evaluate languages anymore, lest they decide cobol is a good idea
jgrahamc1 day ago
And this is partly why my development machine is a Raspberry Pi that I can image any time by removing the SD card: https://blog.jgc.org/2026/04/raspberry-pi-as-isolated-ai-cod...
Shank1 day ago
I mean that's lovely, but you still store confidential data, I assume, like credentials on your development machine? This doesn't solve anything but the least important "reinstall the OS post-compromise" step.
jgrahamc1 day ago
On that machine there's Claude's authentication for my account so I can run Claude on it, a public key so I can SSH to the box, and a private key for GitHub access.
smsm421 day ago
This had been going on for years. I'd expect there would be some kind of solution for now? Like banning scripts and only allowing them to be executed at the explicit user request, for example (not a guarantee but at least a barrier) or somehow restricting them from accessing stuff that does not belong to packaging system. I mean, we have millions of people in the ecosystem, and we keep having this problem for years. Maybe we should ask Claude Code how to fix it (sad laugh)?
staticassertion1 day ago
The solution is to do exactly what you suggest - separate access. In CI this is a matter of having your "build/test" jobs happen separately from your "deploy/publish" jobs.

The trickier part is dev environments, but ideally you take a similar approach. The place that devs do `npm install` should be isolated from, say, your browser / ssh keys etc.

Package manager support would be an amazing win here since you'd have an easier time managing the isolation but you can do this today.

nojs1 day ago
One solution I haven’t seen recommended much is to have a Claude instruction/skill that explicitly audits the diff of every upgrade, and force this manual audit as part of your upgrade workflow. This seems like it would work pretty reliably.
quantumleaper1 day ago
This is what many AI supply-chain security startups (like the one that posted the article) are already doing with all NPM packages, so save yourself the Claude tokens. All of these compromises were detected within minutes, but it takes some time (<1 hour) for NPM to unpublish all of the affected packages.
PAndreew1 day ago
Sorry for my ignorance, but then couldn't we build this into NPM itself? So before a package is publicly available it would be quaranteened and checked.
madamelic1 day ago
Super dumb question as someone who has been using some form of AI for dev since 2023:

How does having an AI audit external code help? Can they not be prompt injected to ignore a malicious change?

I guess I am sort of concerned that they are a pretty thin layer and even if you put "DO NOT ALLOW PROMPT INJECTION", it's a bit like saying "make no mistakes". There _is_ a priority between `system` and `user` level messages as I had recalled, so a specifically made tool that has its own system prompt should prevent injection while asking Claude CLI could still allow for prompt injection.

What are your thoughts and experience?

Yokohiii1 day ago
There are prompt guard classifiers that can detect prompt injections, but they are not perfect (false positives, obfuscation) and should be only a part of the defense.

The concern is real and unsolved. I think security researchers have an advantage here because they still can fall back to manual audits if their automated analysis (or scores thereof) is off.

troad1 day ago
I'm very glad I never bought into fullstack JS/TS.

My JS is frontend only, served as a compiled bundle off a server that doesn't even have a JS runtime of its own. Whatever random vulnerabilities the frontend contains are limited in blast radius to the user's own browser, and since all frontends should be untrusted anyway, there is no real security risk to the server or backend. No reason to update more than a few times a year, if that.

Combine with obvious basic security practices like pnpm cooldowns + no build scripts. When you upgrade a few times a year, and frontend vulns don't matter, there's really no limit to the cooldown you can set. 60 days, why not.

mghackerlady1 day ago
Also, I feel like a lot of fullstack JS is written by people who started with frontend JS and don't have nearly enough backend experience
sph1 day ago
JS programmers today are the PHP programmers of 25 years ago. Remember how many SQL injection bugs there was at the time? Little Bobby Tables remembers.

The standards haven't changed; for the vast majority of JS programmers, this is their first programming language and they have no solid foundation of architecture and security.

So what you get are these overly enthusiastic newbies that want to share their latest achievement with the world (say, a function to left pad a string), and why not include a fancy post-install script with emojis that makes adoption even simpler for other complete noobs? And this is the result.

erikerikson1 day ago
I wrote a little PHP about 25 years ago and hated it, dropped it like a rock as soon as it wasn't my job. Before that basic, assembly, c, and c++. Then scheme, C#, Java, prolog, and others too minor to mention before I started using nodejs. My last company I chose full stack Typescript and it was great. There's a lot to love and a plenty to avoid.

You're not wrong that there's a lot of crap, a massive legacy, and some bad behavior. It is also approachable, flexible, and portable. Even if you sometimes need to say "Wat?!?"

mghackerlady1 day ago
And before PHP it was Visual Basic, and COBOL even further back. I'm convinced trying to teach people to program without them understanding the basics of how computers work will lead to this.
troad1 day ago
I came from systems programming, so I think half of what happens in JS is nuts.
mghackerlady1 day ago
A lot of JS is nuts, but most of its basic behaviour that makes it not a good backend language make it an alright scripting language for the web specifically. I wish we would've used something tcl-y instead though, it's much cleaner and the "everything is a string"-ness makes sense for a fundamentally text based medium (the web)
erikerikson1 day ago
> compiled bundle

Where does that compilation happen again? Not on the front end and it happens exactly where the exploits have been targeting (dev and build boxes).

troad1 day ago
Hardly a factor when you're (deliberately) months behind.
ZiiS1 day ago
It is your development machine's AWS keys they want. The server's keys should be too finly scooped anyway.
troad1 day ago
Not likely to be a major risk if you update every few months, to some major version that's already over a month old.
wavemode1 day ago
I would imagine it's the opposite. Most dev's machines can't query the prod database, for example, whereas a prod server can.
erikerikson1 day ago
Nope, they've been targeting credentials so they can deploy whatever they like into prod. They prefer the build machine with it's broader rights than the individual dev boxes.
austin-cheney1 day ago
If you serve any third party logic, such as advertisements, your code is just as potentially compromised.
troad1 day ago
Only the frontend, which is already untrusted. Any risk would be restricted to individual users who used the compromised frontend to communicate something sensitive, and while that's not great, it is significantly better than the backend being compromised. A very significant reduction in blast radius.

Funnily enough, I don't actually think I do serve third party JS, though. Don't serve ads, don't use external telemetry, don't use JS CDNs. I don't think you have to go quite as far as I do, though - I imagine if your ads are Google AdSense or something, you're probably going to be fine.

tln1 day ago
pre- and post- install scripts should just be abolished. It should require a special dispensation from npm to even publish one.

Yes, I choose to use pnpm but opt-in safety isn't going to get the developer community to herd immunity.

jonkoops1 day ago
Another day, another pre/postinstall script executed that could have easily have been prevented by any sane package manager. NPM really desperately needs an 'allowBuilds' style allowlist [1] and 'approve-builds' command [2].

1. https://pnpm.io/settings#allowbuilds

2. https://pnpm.io/cli/approve-builds

wereHamster1 day ago
After I upgraded pnpm to v11, I set all allowBuilds to false and have not observed any failures. Made me wonder why the packages even need build scripts. My guess is for obscure or old platforms, but for most users running on Linux or Darwin build scripts seem to be unnecessary.
n_e1 day ago
> Made me wonder why the packages even need build scripts

As the name implies it's for building stuff. Most (all?) packages that use C++ FFI with node-gyp need it. A popular package that needs it is re2.

Many newer packages bundle prebuilt native code as transitive dependencies, so build scripts are less needed than before.

Tade01 day ago
> Made me wonder why the packages even need build scripts.

Historically it was to accommodate packages like the original SASS compiler:

https://sass-lang.com/ruby-sass/

Other times it was to avoid shipping binaries due to, erm, safety concerns. The package would include code in a different language, which in turn would compile into a binary library or executable.

perkovsky1 day ago
Agree. Postinstall scripts should be explicit opt-in, not ambient capability.

Most packages should not need arbitrary code execution during install. And when they do, that should be obvious during review.

The default should probably be: install files, don’t run code.

Rohansi1 day ago
If postinstall scripts are restricted the people behind these attacks will switch to something else. Package code is executed automatically by Node when imported, which could be a good replacement. It'll probably run when tests run instead but it's still going to run for most people.
AgentME1 day ago
Another supply chain attack found and blocked in a day. Everyone regularly using npm to install new packages should be using npm's min-release-age setting to avoid package versions that are newer than a few days old to avoid most attacks in practice like this. You can set it to two days with `npm config set min-release-age=2` for example. https://cooldowns.dev/ has info about equivalent settings in other dependency managers like PyPI and Cargo.
sevenzero1 day ago
Or just use dependencies from 6 years ago and never update them like most companies i ever worked for.
halfcat1 day ago
Accidental true leadership
perdomon1 day ago
writing your own code is only harbor in this storm. vanilla js cries out into the night sky. will you answer?
pmdr1 day ago
That and vendored HTMX. Nobuild. JS on the backend looks more and more like a very bad idea.
Advertisement
kixxauth1 day ago
Vendor your dependencies, clone or port them where needed, and freeze them. Most good packages these days do not have a deep dependency tree, and we should stop using the ones that do.

I spent a week with claude and codex re-implementing several packages which had dependency trees deeper than I would like.

Most of these packages are trivial to clone.

"But now you're not getting the upstream fixes" they will say.

"So what?" I reply

no-name-here1 day ago
Wouldn't just having devs pin/not upgrade packages accomplish about as much, have the added benefit that if a package is discovered malicious it would be removed from npm but if already vendored you’d still have the vulnerability on your vendored copy, and pinning versions seems like it would be more likely for devs to do than vendoring?
cj1 day ago
Pinning the version also avoids the risk of accidentally introducing new vulnerabilities while reimplementing the package yourself.
erikerikson1 day ago
Not to support the GPs choices (they are not mine) but pinned dependencies can get grumpy over time with endless LTS migrations.
827a1 day ago
I can't wait for npm/github to do literally anything at all to mitigate these attacks. Literally anything. Have we considered a basic WAF-style block on some postinstall script strings? LLM-assisted code scanning on publish? Is there anyone home? No I suspect not.
WorldMaker1 day ago
It still seems wild that npm hasn't gone allowlist-only for pre- and post-install scripts like every other JS package manager (yarn, pnpm, Deno, Bun). Obviously it would be a breaking change that might wreck some developers' day for a little while until that allowlist is built, but it would go a long way to eliminate some of the biggest vectors for these attacks.
zahlman1 day ago
... Deno and Bun manage packages? I thought they were just runtimes.
WorldMaker1 day ago
Bun started out with npm compatibility as a key requirement, so has a very npm-like package manager from the beginning.

Deno at first tried to focus only on web-like/browser-like package management with a focus on full URLs ("https://mypackage.example.com/v2/mypackage.js") and importmaps (a JSON file mapping "mypackage" to a URL such as the previous example) and package/file caching over installing. Deno 2 made Node-compatibility a higher priority (partly because of Bun's competition, partly because of complaints that Deno was hard to migrate to piecemeal from existing Node codebases) and one of those initiatives was a more npm-compatible package manager out of the box (that can also speak Node package.json and manage a node_modules directory), even as Deno still encourages for greenfield projects the URL/importmap/caching approach (with the expansion that it also understands `npm:` pseudo-URLs, `jsr:` pseudo-URLs [an alternative package registry with a stronger focus on ESM and Typescript types], and `node:` pseudo-URLs [emulated node internals], beyond just browser-safe `http:` and `https:` URLs).

pier251 day ago
Third parties can detect compromised packages. It’s ridiculous Microsoft doesn’t.
dawnerd1 day ago
They will once they figure out how to charge for it (which GitHub is trying according to the security scanning banner they keep showing me).
mannanj1 day ago
Why would a corporate company actually demonstrate responsibility and ethicality in its use of the open source commons from which it extracts every last penny and dollar?

Edit: a more suitable strategy is to do the minimal necessary actions for appearance purposes only, as its how to focus and optimize on its interest for revenue for its shareholders.

lyu072821 day ago
They can and do indeed detect those attacks, it's just from Microsoft's POV a feature of Microsoft Defender (on Windows and Cloud) they sell:

https://www.microsoft.com/en-us/security/blog/2025/12/09/sha...

https://azure.microsoft.com/en-us/pricing/details/defender-f...

So this is presumably why they will never address this in npm itself.

grim_io1 day ago
Maybe they should prove their shit works first.

What a wonderful marketing opportunity! Leave it to Microsoft to blindly ignore it.

KolmogorovComp1 day ago
What would be the required budget to host an alternative registry? I'm surprised any GAFAM still hasn't stepped-in and started building their alternative, at least for NPM to up its game in order not to become completely irrelevant.
ruined1 day ago
at amazon, they maintain a private internal registry of packages with approved licenses and audits. this has been in place for several years. i assume other big corps enforce similar policies
a1o1 day ago
Do you know if they are using any product like JFrog for this or rolling their own?
jon-wood1 day ago
This is Amazon, the company where the stuff they rolled their own now makes more money than the business it was rolled for: https://aws.amazon.com/codeartifact/
philipwhiuk1 day ago
If your company not running an internal proxy at minimum you're stupid - you have no audit function for what libraries are being pulled.
timfsu1 day ago
PSA - you can run something like `npm install -g npm@11.10.0; npm config set min-release-age=3` to update to a version of npm that supports the min-release-age configuration
aa-jv1 day ago
Node is the Visual Basic of our day, if Visual Basic had the ability to update itself from a thousand strangers, any minute of the day, without the user-developer having any clue what is going on behind the scenes unless they apply the very skills that would have precluded their use of Node/Visual Basic in the first place.

All that ease-of-development is being paid for by ease-of-rooting.

ares6231 day ago
If you think about it, this is actually a new kind of security. Security by numbers. Overwhelm the attackers with so many compromised services and devices that they get a reverse denial of service. It's inspired by nature in herd animals.
throwa3562621 day ago
Security by giving up
kunalsin9h1 day ago
As similar to 1st wave of Shai Hulud, this also got it through opentionalDependency. intresting
freakynit1 day ago
codedokode1 day ago
If you are using NPM for business, you should be paying for a repository which was checked by antivirus company and not rely on free repository supported by unpaid volunteers.
CafeRacer1 day ago
i run all my stuff in vm's built with nix

not as easy as docker, but i have a few bash scripts that simplify things for me a lot

i hope that this protects me from the sweep attacks at least

Advertisement
fnoef1 day ago
I’m honestly at a point where I’m afraid to update any of my project’s dependencies, and I’m also afraid to run the locally without some locked down VM
darkwi11ow1 day ago
I use Tanstack in my projects. Last week when Tanstack got compromised, it was only my laziness that saved me -- was thinking about doing pnpm upgrade but got lazy and played some dota... Finished game was just going to pnpm upgrade, opened hacker news and boom! news hit.

Since then, I had set up libvirt/qemu based VM with another Linux running in it specifically for development. Now I run all of docker, kubernetes, IDE, pnpm, uv, etc in that VM and removed them from host. The only write capable secret VM has access to, is my passphrase protected ssh key, which I can quickly revoke from my Github account in case of compromise. Feels much safer now.

exiguus1 day ago
I also was at this point, and I decided to add cooldowns to every project.
fnoef1 day ago
Yeah, I agree, but then you are at the mercy of whatever vulnerability is found in the current version(s). It just feels like a lose-lose situation no matter what you do.
tpetry1 day ago
You can still update to new versions even if the new release is still in cooldown phase. You just have to be explicit that you want the new release.

pnpm audit —fix for example will whitelist releases in cooldown phase when theres a known security issue for a version you currently use.

thrownthatway1 day ago
So long as we insist on everything from a light switch, the vacuum cleaner, security camera, clothes dryer, TV, car, and mobile phone being an always on, always online, Universal Turing Machine we’re not going to find a solution.
dmitrygr1 day ago
Libc still unaffected. Write native code. Your users will thank you
knlsn1 day ago
are these fixed removed now?
Brybry1 day ago
Seems like it is fixed/removed: https://github.com/antvis/.github/commit/cb641113703e531ee43...

Some are still on npm but marked "deprecated":

https://www.npmjs.com/package/size-sensor/v/1.0.4?activeTab=...

As the article states, you can see in the package.json that the optionalDependencies references "@antv/setup": "github:antvis/G2#7cb42f57561c321ecb09b4552802ae0ac55b3a7a"

I'm pretty sure those commits have been removed from github:

https://github.com/antvis/G2/issues/7401#issuecomment-448480...

https://github.com/antvis/G2/issues/7394

somelamer5671 day ago
In the fictional universe of William Gibson's Sprawl trilogy, it is legal and normal for defenders to go kinetic on cyberattackers. How long until it is simply easier for governments and big business in the countries victimised by these criminal groups, to find the path of least resistance and go after them personally?
thrownthatway1 day ago
We can’t even prevent shop lifting.
somelamer5671 day ago
Shoplifting isn't a national security matter.
thrownthatway1 day ago
It’s an issue affecting the nation.
sitkack1 day ago
Compared to what?
thrownthatway1 day ago
Are you ok?

Compared to calling in air support on cyber criminals.

How’s your reading comprehension coming along?

abhisek1 day ago
Attackers are just having fun due to abysmal state of npm and some of the insecure design choices by GitHub and GitHub Actions. Every attack gives them credentials which in turn used to stage more attacks.
cyanydeez1 day ago
perfect capitalism writ technology
thrownthatway1 day ago
You making a good point.

Socialism or our right communism would probably fix this.

But only as a second order effect of fucking everything.

3.5 to 6 million Ukrainians died in the Holodomor.

None of them really had any issues with technology. Not so much because they didn’t have any, but more so because they were dead.

LtWorf1 day ago
What they do is already illegal. The problem is finding out who they are and where they live to go and arrest them.
thrownthatway1 day ago
I’m not convinced.

My understanding is that the problem is more that calling in the heavy artillery for what amounts to an annoyance, and maybe some financial harm, is generally considered impolite, even among nations that have conflicting worldviews.

mycall1 day ago
When you have AI models finding vulnerabilities by themselves in a for-loop, it isn't long before there is no human to go kinetic on.
moi23881 day ago
Because of course it’s npm
type01 day ago
Does npm stand for "newly packaged malware"?
Ygg21 day ago
Akshully, "Node Packaged Malware."
thrownthatway1 day ago
Needs more recursion.

NPM - NPM Packaged Malware

wolfi11 day ago
should be a meme
matheusmoreira1 day ago
Every programming language package manager is affected. Any random person can sign up and push packages. They are all equivalent to the Arch Linux User Repository and have the exact same caveats.
grey-area1 day ago
I last added a new dependency to a large project I work on a couple of years ago. So no, not all ecosystems are the same.

The culture makes a difference.

stephenr1 day ago
How many other languages of any kind have a standard library that is so bizarrely lacking as JS?

Now how many other mainstream languages of any kind have a standard library that is so lacking?

Now how many other mainstream languages have a swathe of front-end developers that suddenly realised they can run code in a CLI or on a server, and spent exactly 0 minutes learning about how to make it not shit?

Now how many other languages get used in scenarios where it makes absolutely zero sense because the developer only knows javascript?

matheusmoreiraabout 12 hours ago
This has nothing to do with standard libraries or popularity. It's about trust.

I signed up for an npm account and pushed packages. Same for PyPI. Same for Ruby gems.

There's no actual reason why anyone should believe I pushed anything but malware in there.

morpheos1371 day ago
it seems obvious to me the ability to push code to public repositories shluld be tied to real human identity.
wang_li1 day ago
Using code from these repositories should be considered the same as licking toilet seats at highway rest stops. There’s something wrong with you if you do it.
teddyh1 day ago
‘No way to prevent this’, Says Only Development Community Where This Regularly Happens

­— <https://itnext.io/no-way-to-prevent-this-says-only-developme...>

jubilanti1 day ago
Yeah funny, but npm is not the only development community where this regularly happens.

The Onion article this joke refers to [1] is funny because there is a very clear and obvious reason why the U.S. has far more gun deaths per capita. This doesn't apply for npm.

[1] https://theonion.com/no-way-to-prevent-this-says-only-nation...

woodruffw1 day ago
The analogy in npm is dependency proliferation, along with what appears to be weaker community norms around security. To the extent that either or both of these are true, I think the “no way to prevent this” quip is essentially accurate.
throwaway274481 day ago
Oh?

Edit: please explain. What other community has this rate of attacks? It's possible they are just detected or publicized less, too. Please help me understand what you're referring to.

Yokohiii1 day ago
I'd also like to know who monitors the casualties.
shoeb00m1 day ago
some Pipy packages were also attacked recently. And is even more vulnerable due to many projects using requirements.txt which doesn’t lock sub dependencies
OhMeadhbh1 day ago
I initially read this to mean NPM has a pro-concealed-carry policy, which I don't think it does and I don't think is what you meant.

But... Node's culture does not reward "rational" policies with respect to dependency management in the same way that the US does not reward "rational" policies with respect to gun control *. But US gun control policy is a reflection of the "will of the electorate" -- i.e. there are a lot of Americans who want (or need) to own firearms. In the same way, NPM reflects the culture of high-speed, sili-valley web-devs.

I mention both not to criticize, but to comment it's not the tool that's at fault here, but the users who demanded it evolve the way it did. We moved fast. We broke things. And some of the things that remained broken were sociological: It's easy enough to add PGP/GPG signatures on packages, but whom do you trust? What is the meaning of a signature? Does it mean the signer warrants the package/version is free from defects?

NPM is working as designed. Users wanted the software construction equivalent of a loaded revolver. But we got something that was a bit more like a nuclear weapon with a large blast radius. At least the revolver user would more-likely only shoot their own feet six times (or twelve if they reload.)

[*] I'm trying very hard not to start a flame-war about gun control, I only mean to point out dependency management in node can be as contentious in it's domain as gun control policy is in the domain of US politics. Note that I am not making a pro or con argument about gun control, but only pointing out the issue exists. The word "rational" is intentionally chosen to reflect the fact that people's opinions on gun control and package management are often based on personal, often emotional beliefs (which should not be dismissed.)*

dspillett1 day ago
> npm is not the only development community where this regularly happens

That is like people defending IIS in the early days by pointing out that Apache occasionally had security problems too. Or, back to the gun control analogy people saying “gun control didn't stop Bondi Beach, did it?” or pointing out [incorrectly]⁴ that everywhere that has gun control has knife crime⁴ instead.

> because there is a very clear and obvious reason why … . This doesn't apply for npm.

I disagree. There are a number of reasons that stack together, the four that spring to the top of my head being:

1. Numbers. There are a lot of potential targets you can exploit if you manage to get something into a ecosystem that large. This “being a big fat target” combined with being easy to exploit makes NPM a very juicy target, and encouraging people to use such a target without trying to implement countermeasures for this sort of attack is IMO reprehensible. Numbers isn't a problem in itself, like in the bad old days when IIS was a mess but Apache got (successfully) attacked far less, but they do exacerbate the security issue by multiplying the attack surface area.

1b. A lot of those using it are relatively untrained or just following recipes so do not know how to protect themselves, and may not even update after an attack like this and remain vulnerable for some further time. While this is not NPM's fault, being due to the popularity/commonality thing, it is something those in control of NPM should care about, if, as I believe is claimed, they care about their users⁰.

2. It is an environment where a ridiculous amount of dependencies, nested impressively deep, is practically encouraged, making audit very difficult even for those who try.

3. A number of good suggestions have been made that would mitigate, or at least vastly reduce, the risks. But action on these has, as far as we know, not happened. Sometimes for good reasons, or at least for reasons¹ rather than “just because”/“cost to implement”/“we don't wanna”, and sometimes, well, not. And no alternatives from within those running NPM are being suggested/worked-on, as far as we know² at least.

4. Those who would make most noise about any change, especially a breaking change that affects them in the smallest way, simply do not care about the risk the situation poses to the wider population.

While the gun control analogy might be a little stretched, I think it is relevant enough particularly because of points 3 & 4.

--------

[0] I refuse to use the word community here. This isn't a cosy little village where everyone knows your name and everyone looks out for everyone else.

[1] Them bringing significant breaking changes, or being too complex to implement piecemeal to give time for those breaks are dealt with or otherwise prepared for, for instance.

[2] If something was being looked into, I'd expect it to be announced³ as that would quieten criticisms like these, at least a little.

[3] Maybe not immediately, but this has been a known problem for so long that we are well past immediately.

[4] When it isn't the case that the US doesn't have knife crime, it just doesn't get reported because the gun issues are worse. Like car travel killing more in total then flights, but you don't hear about every car crash. The UK is often given as an example in these comparisons, but if you look at the stats our knife crime rates are lower than the US's - it isn't that other countries have knife problems instead, the US has worse knife problems as well as the guns problem.

ErroneousBosh1 day ago
> Yeah funny, but npm is not the only development community where this regularly happens.

What are the other ones? Does this happen with the same sort of frequency?

fennecbutt1 day ago
Isn't this more like a "Macs don't have viruses" type scenario though?
pletnes1 day ago
I thought it was «windows has all the viruses» since there are a lot of npm packages and it’s used by a lot of people?
ch4s31 day ago
NPM by virtue of its popularity and the vagaries of the ecosystem is always going to be a prime target for attackers, and people (maintainers) will always be a weak point.
freedomben1 day ago
I agree generally, but I also think it's important to point out that in the NPM ecosystem it is culturally acceptable and even encouraged to install even trivial dependencies to avoid reinventing the wheel. Philosophically I completely agree with this, though practically we see the result and it is not good. The left pad debacle should have been a huge wake up call, but not really much seems to have changed after that.

As long as developers in the ecosystem are cavalier about installing huge chains of dependencies, NPM will be an attractive target for attackers.

Even though we wish it were not so, cultural problems seem to be the hardest technical problems to solve.

shoeb00m1 day ago
Most of these attacks have nothing to do with installing trivial dependencies. It’s usually because the authors npm tokens got hacked; often due to github actions.

The issue is that github actions has too many security gaps that are easy to miss.

gabdpipi1 day ago
Yeah I was thinking the difference between open source and enterprise to mitigate this is a simple hardware security module right?

If the attackers spearfish folks who hold “keys to the castle” and everything is digital it’s game over no matter what ecosystem.

Those things should be locked down by “something you have” because that’s much more difficult.

OhMeadhbh1 day ago
What will cryptography buy you in this instance? Do digital signatures imply virtuous behaviour? Does the lack of a signature imply vice?
tialaramex1 day ago
The "No way to prevent this" analogies seem to me to work better for Memory Safety because, as with Gun Safety, the simple fact is that everybody knows how to solve the problem, but one group insists it's impossible.

There is crowing from the "Actually copy-paste is better" people when this happens, but when it's their turn they just jam their fingers in their ears. The memory safety and gun safety problems are the actual problem. Shai-Hulud would ruin your day if it got into the Odin release you used to build your software, or it was copy-pasted into your "vendor everything" C++ project, the choice not to have automation doesn't mean you fixed the problem.

cuuupid1 day ago
I'll disagree because the primary issues with gun control in the US are:

[1] Guns are a core part of culture for much of America, very deeply so outside coastal cities. Most of the left wing in the US lives in coastal cities and either grew up there or immigrated very recently and does not leave, so this is an alien concept to them, but even in very blue cities like D.C. you would be shocked how many liberal democrats have armories. It is literally amendment #2!

[2] They are already widely distributed and it would be a logistical impossibility to actually enforce gun control.

This is directly analogous to NPM where:

[1] The package registry working the way it does and people quickly installing packages without thinking much is deeply part of JS culture. It doesn't help that JS caters very heavily to as wide of a market as possible, of which the majority is going to be entry level/junior to associate engineers for whomst script kiddying or letting AI install whatever is essentially a way of life. As evidence, this type of thing is not really a problem with derivatives like Bun, especially in mature organizations where it's easy to enforce a minimum 72 hour wait time between publish and installation of a package.

[2] Packages are already widely distributed and part of dependency stacks (e.g. the infamous leftpad) where it is a logistical impossibility to change how things work.

I also view startups and companies like Vercel as essentially the NRA here, Next.js has taken over huge swathes of the ecosystem and highly encourages dependency-maxxing.

Another direct analogy: proponents of gun control say they are unnecessary for self defense (esp. because law enforcement is good now), too heavy duty to begin with, and fundamentally dangerous.

Similarly I would criticize dependency-maxxing as unnecessary for capability (esp. because AI is good now), too heavy duty to begin with, and fundamentally dangerous.

tialaramex1 day ago
The whole reason this joke works is because of exactly your belief that somehow you're different and the solution which works for everybody else can't work for you. Charlie is always going to try to kick the ball and Lucy is always going to pull it away and Charlie will never learn from this experience no matter how often it is repeated.
rossjudson1 day ago
Gun deaths in the US are just the cost of doing business, and business is booming (for some).

Sad.

nonethewiser1 day ago
>The "No way to prevent this" analogies seem to me to work better for Memory Safety because, as with Gun Safety, the simple fact is that everybody knows how to solve the problem, but one group insists it's impossible.

I'm not following. Whats the 2nd Amendment equivalent for memory safety? The amount of C/C++ in production or something?

toast01 day ago
> A well regulated Memory Operation, being necessary to the security of a free Computer, the right of the people to keep and bear Pointer Arithmetic, shall not be infringed.

(maybe workshop this)

ErroneousBosh1 day ago
> the simple fact is that everybody knows how to solve the problem

Don't make braindead My First C Program mistakes?

ajross1 day ago
The Node ecosystem happens to be more vulnerable for social and software design reasons, it's true. But people need to be aware that PyPI and Cargo et. al. are not in any fundamental way less vulnerable. This will happen there too.
zahlman1 day ago
In fact, attacks like Shai-Hulud explicitly attempt to get into PyPI, and have succeeded to a lesser extent.

But aside from the package-size / -complexity issue pointed out in a sibling comment, PyPI also tries a fair bit to monitor for incoming malware (and there's a "report project as malware" button on each project page).

Also, there are no post-install scripts (of course, the code can detect when it's being run for the first time in the installed environment); and pre-install scripts are only included in sdists[0]. So you can easily[1] configure your installer such that you at least won't get pwned at install time, at the cost that some[2] packages can't be installed that way. And then you can go inspect, run a security scanner over, etc. whatever got installed; wheel installations just copy things to well-defined locations and generate simple wrapper scripts by strict rules.

[0]: I.e., when the project is "being built from source", which generally is only necessary when it includes non-Python code directly and the maintainer hasn't pre-built that code for your system.

[1]: Notwithstanding that, with pip, many actions that you'd expect not to get you pwned totally can. Such as, for example, explicitly telling it to download an sdist and not install it; as I discussed in https://zahlman.github.io/posts/python-packaging-3/ .

[2]: In practice, a pretty small fraction of what typical developers would actually care about, at least outside of specific niches. I'm told there are some niches where it's a big problem, but honestly they're lucky that this kind of build-install orchestration sort-of works at all.

zarzavat1 day ago
To expand on this, PyPI is slightly less vulnerable because Python users tend to install mega packages (such as numpy or django) and do not frequently interact with their package manager. There is also not a culture of using sub-dependencies.

Cargo is essentially the same as NPM though, it's only "safer" because it's less popular.

Although the situation on NPM is extremely uncomfortable, you're probably less likely to get hit if you take reasonable precautions than on PyPI, simply because NPM is getting scanned more often. Most of these attacks on NPM have been detected and pulled days before my min age kicks in. A sleeper attack on PyPI could be devastating.

mghackerlady1 day ago
Language exclusive package managers like this are nightmares for security, but npm simply does things so poorly I feel like they wanted something insecure.
fmbb1 day ago
What about language exclusivity makes a package manager a security nightmare?
a1o1 day ago
Now I have to wonder if someone is targeting Homebrew too, thanks
b0rtb0rt1 day ago
after running the original version of this into the ground we can run this one into the ground too
mschuster911 day ago
> Says Only Development Community Where This Regularly Happens

We've had such issues on other places as well... Shai-Hulud got into Maven [1] and PHP Composer [2], typosquatters got into Maven [3], and it's not new either [4].

No one is safe from skiddies, much less from nation state actors.

[1] https://thehackernews.com/2025/11/shai-hulud-v2-campaign-spr...

[2] https://semgrep.dev/blog/2026/malicious-intercom-php-package...

[3] https://www.esecurityplanet.com/threats/malicious-jackson-lo...

[4] https://socket.dev/blog/malicious-maven-package-exfiltrates-...

gred1 day ago
Your example of security issues in Maven is... npm guys setting up processes to auto-publish infected npm packages into the Maven Central repository?

Wake me up when the daily npm security breach headlines are typosquatting stories, not RCE-on-build or RCE-on-upgrade.

mschuster911 day ago
> Wake me up when the daily npm security breach headlines are typosquatting stories, not RCE-on-build or RCE-on-upgrade.

RCE-on-build/upgrade can be done in Maven if you manage to compromise one of the major Maven plugins, they run at build time. The thing keeping maven safe for now is that most people pin the plugin and dependency versions, with the obvious side effect that it's truly annoying to get all your dependencies updated.

anonym291 day ago
"A well administered supply chain, being necessary to the freedom of an open internet, the right of the developers to keep and bear hundreds of uninspected transitive dependencies, shall not be infringed."
Outlook58131 day ago
another day, another npm hack.