Remix.run Logo
NPM packages from Red Hat have been compromised(github.com)
415 points by kurmiashish 2 hours ago | 211 comments
jofzar 2 hours ago | parent | next [-]

'No Way to Prevent This,' Says Only package manager Where This Regularly Happens

Edit: some people don't understand that it's a defence to https://en.wikipedia.org/wiki/%27No_Way_to_Prevent_This,%27_...

Someone1234 2 hours ago | parent | next [-]

Let me provide context, since a bunch of people responding with "every package manager can be hit!!!" npm, by design, allows all packages to run package supplied arbitrary code as the logged-in user after an update completes.

That's an INSANE default. pnpm, by contrast, allows you to essentially "opt-in" only specific packages that need this (e.g. four out of thirty, in one of our projects). Then tacks on tons of other security settings, like minimum age, no trust downgrade, etc etc.

All attackers can attack packages by updating how a package functions; but npm is particularly problematic as it runs non-sandbox scripts as the calling user. Putting not just your project at risk, but your entire machine/network.

And this stuff has been known about for YEARS, they've taken no action.

bob1029 an hour ago | parent | next [-]

Furthering the idea that not all package managers are the same, there are entire cycles of the moon where I don't open nuget once. Some ecosystems simply don't need to vendor out very often, and these are the ones where you generally find the least news like this.

In about 99% of cases, I have the option to pick between Microsoft, a 3rd party or myself. I'm picking that first option every time I can. If M$ can't handle it, I'm hand rolling it.

Dapper remains the only constant 3rd party dependency in my projects. I don't know how much longer this will last with LLM assistance. The frontier models are very good at writing repositories over arbitrary sql schemas with low level primitives now.

johannes1234321 an hour ago | parent | next [-]

> Furthering the idea that not all package managers are the same, there are entire cycles of the moon where I don't open nuget once. Some ecosystems simply don't need to vendor out very often, and these are the ones where you generally find the least news like this.

This however is only to some degree the package manager's fault. The JavaScript culture is strongly ordering tiny packages by individual people doing small things (left pad) rather than larger utilit libraries maintained by a larger community.

A larger community contributing to a larger library would mean that a larger community feels responsible and checks it.

That small package mentality a trace to web usage: JavaScirpt code is often sent to the client, not having a huge library but having small dedicated libraries means that it is a lot simpler for the bundler to not bundle dead code which is sent to the browser client.

With server side Node.js this lead to tons of dependencies ... which is worsened by npm allowing to have multiple versions of the same package in parallel. So if something depends on leftpad 1.0 and something else in leftpad 1.1 both are fetched and both are available.

homebrewer 34 minutes ago | parent | next [-]

This has been improving recently; one large project built on several heavy libraries that I've been supporting since 2018 currently installs ~180 dependencies without loss of functionality compared to how it worked, and what it depended on, back in 2018.

IIRC 6 years ago the full dependency tree congealed into more than 2000 packages. One small example is React itself:

- 5 deps: https://www.npmjs.com/package/react/v/15.6.2

- 0 deps: https://www.npmjs.com/package/react/v/19.2.6

Another is switching from create-react-app with its hundreds of transitive dependencies to vite, which, according to the test I've ran just now, currently has 15. Etc.

oblio 13 minutes ago | parent | prev [-]

> That small package mentality a trace to web usage: JavaScript code is often sent to the client, not having a huge library but having small dedicated libraries means that it is a lot simpler for the bundler to not bundle dead code which is sent to the browser client.

Which is another part of this entire insanity:

Browsers are already <<huge>>. They're also built by <<huge>> companies companies that collect <<tons>> of analytics.

You'd think at this point they could present a proposal for a rock solid extended JavaScript standard library that would be based on actual website usage and would be comparable to what Java, .NET offer, obviously only keeping the parts that would be applicable to the web.

It sounds crazy but I think the Chrome installer is 150MB and an entire decent stdlib these days would probably be 1-5MB...

homebrewer an hour ago | parent | prev [-]

How large a project do you typically use dotnet for?

IME dotnet dependency situation is a tire fire, not a month goes by without another dependency biting the dust or going fully commercial with no notice. Which is fair, I suppose, but Go and Java ecosystems don't have it nearly as bad.

orphea 14 minutes ago | parent [-]

I don't think going commercial has been that impactful. It sucks, it betrays the spirit of open source but whatever. A few examples:

- FluentAssertions had no moat, and it has been forked as AwesomeAssertions. Not sure what the author's play was here.

- Moq lost trust - we have NSubstitute

- AutoMapper and MediatR have been widely misused anyway

- Maybe MassTransit is a real bummer?

matheusmoreira 41 minutes ago | parent | prev | next [-]

> allows all packages to run package supplied arbitrary code as the logged-in user after an update completes

As opposed to the completely untrusted package supplied arbitrary code that the logged in user executes when they actually use the package immediately after installing it?

saturn_vk 25 minutes ago | parent [-]

The package might not ever be executed on the user's machine. Depending on your setup, it might only be ran on a server, where the data that can be exfiltrated is completely different.

PunchyHamster a minute ago | parent | next [-]

Why you are downloading code if you're not even using it to run tests ?

And if you run tests in CI/CD, or in a container, why you are downloading code locally ? Only thing that comes to mind is code completion but surely most people at least run unit tests locally before pushing the code out ?

Petersipoi 16 minutes ago | parent | prev [-]

Sure but like.. come on. Is that really a defense? Most packages are run on devs machines. And it's not like "Oh it's just running on my production server, what could go wrong there" is any better.

chrisweekly an hour ago | parent | prev | next [-]

Yes, this.

Regarding npm CLIENTS, PNPM is fundamentally different from (and superior to) npm or yarn.

Strongest possible recommendation to use pnpm.

It's also a good idea to use a private registry (eg via jfrog), acting as a proxy / pull-through cache, and point trad SAST and maybe AI scanners at it.

But dropping the npm client in favor of pnpm is a no-brainer. Speed, disk space, security, determinism, flexibility, fine-grained control over your dependency graph...

rixed 14 minutes ago | parent | prev | next [-]

One hour ago, while looking casually at a package.json, I saw this and was horrified:

  rm -rf pkg/snippets & rmdir pkg\\snippets /s /q & wasm-pack build --target bundler && node prepare-web.js
Looked like a strange mix of unix shell and msdos batch that would, on my box, try to rmdir "/s" and "/q". I asked Claude about this, and he replied something like "Yes that's a standard and clever hack to delete a directory that works both on linux and windows!".

Poor Claude has been trained on so much awful human code that it required several prompts for it to admit that there was indeed a problem.

The industry is the process by which convenient crap like this gets standardized.

lokar 5 minutes ago | parent | next [-]

Yikes. I would never approve a PR with that in it.

PunchyHamster a minute ago | parent | prev [-]

> Poor Claude has been trained on so much awful human code that it required several prompts for it to admit that there was indeed a problem.

Claude probably birthed this abomination in the first place

sigmoid10 an hour ago | parent | prev | next [-]

>Putting not just your project at risk, but your entire machine/network.

Between average hackers and extortion groups, foreign governments and state sponsored actors and last but not least my own government, I don't think there's much room left for non-compromised supply chains these days. Treat everything that can run foreign code as potentially compromized and keep everything compartmentalized. If you keep your crypto wallets or private banking info on the same machine where you do development, you're asking to get shafted one day. Or if you keep your big corporate github keys on the same machine where you do private weekend projects. It doesn't matter what you use in particular, even if some vectors are currently more popular than others.

Kuinox an hour ago | parent | prev | next [-]

Mosts packages manager, allow that.

pnpm can still be exposed, afterall the worm simply have to wait you run tests locally.

homebrewer an hour ago | parent | next [-]

You can isolate it through bubblewrap; I moaned about it here and there's no point in repeating it:

https://news.ycombinator.com/item?id=45041798

If you only ever use js/ts for frontend projects (like we do), it closes one major hole that I'm aware of, which still leaves at least two:

- the editor possibly starting random binaries from inside the mode_modules (such as biome, vitest, tsgo)

- escape from sandbox by using some kernel vulnerability, of which there have been many recently

Someone1234 an hour ago | parent | prev [-]

I suppose.

But that's a "Perfect is the enemy of good"-like argument. Wherein: Why even reduce an easy to exploit attack surface when there could be holes elsewhere?! Because, you know, it makes things much more secure even if imperfect.

Plus, to me, it is a culture issue. npm just doesn't take security seriously, so we don't see these improvements, and if there was additional test hardening later, I don't expect we'd see them in npm either. Since, they just don't care.

Kuinox an hour ago | parent | next [-]

The biggest problem is not software but culture, not at npm, but in the js ecosystem. The js ecosystem is simply a juicy targets, the attack surface is enormous. The attacker can make their attack more sophisticated, there will always be a maintainer that can seed the worm spread.

Meanwhile in the nuget ecosystem is way smaller and have way less mainteners involved for a single given dependency.

lenerdenator 23 minutes ago | parent [-]

I'd go further and say that how JS and the web itself has been run over the years has predisposed it to this sort of thing.

JS didn't have a passable stdlib until ES6. It had bugs built into it because Eich was given a stupidly short time window to deliver the first version. Everyone (particularly MS) had (and still sort of do) their own way of interpreting the language. In spite of all of this it became the primary way of developing applications for public consumption.

This led to a bunch of people who wanted to be the 10x JS engineer to solve problems with their own libraries and technologies. None of them really talked, they just threw their packages on NPM's registry without second thought and some gained widespread use just by accident.

Google tried fixing some of this with Dart but chickened out at the last second. TypeScript was designed by someone competent but can't fix the larger cultural issues.

This is what happens when you put SV hubris and "moving fast and breaking things" over doing things the right way.

CoastalCoder 22 minutes ago | parent | prev [-]

> Why even reduce an easy to exploit attack surface when there could be holes elsewhere?! Because, you know, it makes things much more secure even if imperfect.

I'm still trying to calibrate my take on this view.

If attacks are randomly chosen from the set of all potential vulnerabilities, without the attacker knowing which ones had been patched, then that logic clearly makes sense.

But in an adversarial situation where the attacker can guess which vulnerabilities you still have unpatched, or can try many different attack vectors, then having already patched some other vulnerabilities doesn't matter so much.

I guess reality is more complicated though.

Romario77 26 minutes ago | parent | prev | next [-]

I think another thing that affects security is that in javascript culture people often tie to the latest version instead of concrete version.

This makes it so an update to a popular library can compromise a huge number of packages that depend on it.

In Java for example almost all packages specify a concrete version, even if someone compromises the latest the blast radius is usually pretty small.

Pxtl 18 minutes ago | parent [-]

MS Nuget is also lock-by-default. Latest-by-default should be considered harmful unless the package manager is directly vouching for the veracity and reputability of the packages.

semiquaver an hour ago | parent | prev | next [-]

> they've taken no action.

Not running lifecycle scripts by default is eventually going to be the default behavior. Late is worse (edit: I meant better) than not at all. https://github.com/npm/rfcs/pull/868

brookst an hour ago | parent [-]

Wait how is being late worse than not doing it at all? Is it true for mortgage payments and apologies?

westoque 25 minutes ago | parent | prev | next [-]

i've been thinking about this as well. but having built a startup, i've learned that users don't care as long as they are given the value and most convenience. they don't really care much at security as much as we do. just look at openclaw? but maybe it's our job to make sure it is taken care of vs assuming the user cares and just make it look seamless.

dns_snek an hour ago | parent | prev | next [-]

> since a bunch of people responding with "every package manager can be hit!!!" npm, by design, allows all packages to run package supplied arbitrary code as the logged-in user after an update completes.

This is semi-common and in no way unique to NPM.

Ajedi32 an hour ago | parent | next [-]

And even in the ones that don't, having to wait until the project executes to begin its attack is a minor inconvenience for malware.

an0malous 39 minutes ago | parent | prev | next [-]

What other package managers do this? I don’t think Ruby does

matheusmoreira 35 minutes ago | parent | next [-]

https://docs.ruby-lang.org/en//master/Gem.html#method-c-post...

dns_snek 16 minutes ago | parent | prev | next [-]

Most of them? Ruby gems have hooks, Python has setup.py, deb, rpm have them too (relevant if you're installing from 3rd party sources). Elixir/Mix doesn't technically execute code on install, but your language server builds the dependencies as soon as you open the project, which can execute arbitrary code.

Either way it misses the point, nobody just fetches code and removing post-install scripts wouldn't change much because you're going to run `npm run something` 5 seconds after you run `npm install`.

IshKebab 25 minutes ago | parent | prev [-]

Python does too I believe.

Really the reason not to allow that is for robustness, not security. You ideally don't want package installs doing random stuff to your system because package authors are generally bad at doing that sort of thing cleanly.

The security impact is relatively minimal because as other people have said, you just installed a package. What's the very next thing you're going to do? Compile/run it obviously.

oblio 11 minutes ago | parent [-]

A lot of packages are pulled in to call minimal bits of the actual library. I obviously don't have any statistics on this but my instinct would say that for the average application only 5% of an average package is actually used.

So not running package installation scripts is a huge, massive problem.

matheusmoreira 33 minutes ago | parent | prev [-]

You're right. I said the same thing and got downvoted too. Don't let it discourage you.

PunchyHamster 4 minutes ago | parent | prev | next [-]

> Let me provide context, since a bunch of people responding with "every package manager can be hit!!!" npm, by design, allows all packages to run package supplied arbitrary code as the logged-in user after an update completes.

Many package formats before NPM allowed for it, and frankly, it matters little, because if it can add code to your app it can run malicious code. The fact it executes on package install rather than when dev runs tests or the app matters little, and in general if environment is sandboxes, the package install is also ran in the same sandbox so disallowing it changes little.

so yes, every package manager can be hit, the reason is twofold

* JS is such a lowest common denominator it has that much more clueless users so just by scale every issue will be more common than in other languages

* extreme fragmentation leading to hundreds of packages needed for even small projects, which is again more chances for compromise

insanitybit an hour ago | parent | prev | next [-]

> That's an INSANE default.

It's also the standard, and by far it's the contrast to not allow this. pnpm has a massive advantage of being the non-standard package manager, npm does not have that - what do you suggest that npm does?

btown 43 minutes ago | parent [-]

There are so, so many things that NPM could do.

It could require a 48 hour cooldown period on any package update that wants to add an install script that didn't have one before, and has a certain number of downloads. And it could publish the list of these so security researchers have an opportunity to scan them.

It could add an optional key to package.json that allows someone to whitelist which packages can run install scripts.

It could add a Hardened Security program where (1) package maintainers could opt into a program where multi-factor confirmation by maintainers is required on every publish, even those triggered by CI; (2) this hardened package status would be public, and (3) a developer could set a flag in their package.json that causes any npm action to act as if all non-hardened packages had frozen versions.

And so much more.

insanitybit 35 minutes ago | parent [-]

You realize that "dependency cooldowns" as a popular concept are extremely new, right? npm manages the installation of dependencies for millions upon millions of users across the globe.

> It could add a Hardened Security program where (1) package maintainers could opt into a program where multi-factor confirmation by maintainers is required on every publish, even those triggered by CI;

Great, they did this.

> And so much more.

This shit takes time. Yes, they should have done this on day 1. Acting like any of this is easy to retrofit is just nuts though.

ImPostingOnHN an hour ago | parent | prev [-]

Nearly every package manager I've ever used had post-install scripts. Most run as root, since that's what usually what the package manager runs as.

It's not unreasonable: you're already installing software, which presents risks. If post-install scripts were not a thing, a payload could still run because you ran the software you installed. Or because the installer added it to auto-run. Or because the installer placed it somewhere where it would be dynamically loaded all the time.

bandrami an hour ago | parent | next [-]

That's why we don't let the developers run system package manager install scripts as root. We do let them run npm inside containers, which is still more access than I'd like them to have.

jdiff an hour ago | parent | prev | next [-]

Most package managers with postinstall scripts are also heavily curated and have reputation systems. As you say, they run as root, so the high trust requirement is definitely warranted. Anyone can upload an npm package.

skydhash an hour ago | parent | prev | next [-]

I think it’s just a bundle of issues. Deep graph of dependencies, distribution of minimized code (java has jars, but I don’t remember scripts), and nearly impossible to audit. With most projects in other ecosytems, you only have to interact with a few developer/orgs. But with npm, you add one library and you need to essentially trust 10s of entities on the internet.

TylerE an hour ago | parent | prev [-]

Nearly every package manager I've ever used had post-install scripts.

You're collapsing two different threat models. The risk isn't that code runs, it's WHEN it runs. This worm spreads because npm install runs arbitrary scripts as you, automatically, just from resolving the tree. You don't have to build it, run it, or even import it. Opening the project in an IDE is enough. apt/dnf scripts run on packages a maintainer signed and a distro gatekept. Not on whatever some rando pushed to a public scope 20 minutes ago that landed in your lockfile six levels deep. "They both technically execute code" is true and beside the point. One runs signed code from a trusted path, the other runs unsigned code from the default automated path. That's the whole ballgame.

ChocolateGod 25 minutes ago | parent | next [-]

> apt/dnf scripts run on packages a maintainer signed and a distro gatekept

Unfortunately apt/dnf isn't much better here because random tutorials online suggest people add random repositories where the creator of any repository effectively has root access to anyone machine that adds it as a remote.

orphea 3 minutes ago | parent [-]

Don't add random repositories from random tutorials? Come on, it's basic Internet hygiene. Entirely different thing.

ImPostingOnHN 2 minutes ago | parent [-]

Don't install untrusted software from untrusted repositories? Like the NPM one? It's basic internet hygiene, developers just look the other way because otherwise it's hard.

ImPostingOnHN an hour ago | parent | prev [-]

> You're collapsing two different threat models. The risk isn't that code runs, it's WHEN it runs.

> You don't have to build it, run it, or even import it

If you just installed something with npm, chances are you'll be running it shortly, either as a tool or a library, probably minutes or seconds later. I imagine the use cases of explicitly install an npm package you don't plan on using, constitute a small portion of npm installs.

chuckadams 2 hours ago | parent | prev | next [-]

The big attacks of today are spread across several package ecosystems: TrapDoor and Shai-Hulud have been hitting npm, pypi, composer, and crates with the same malware.

throwwwll 2 hours ago | parent [-]

And all of them "thought" of security as an after-after-after-after-after-thought.

freakynit an hour ago | parent [-]

Most of these are now building upon techniques that have already been exploited since past 1 years. This attack used 4 of those techniques.

1. Lifecycle Hook Execution

2. CI/CD Identity Plane Attacks

3. Maintainer Account Takeover and Malicious Publish

4. Self-Replicating npm Worms

https://npm-supply-chain-attack-techniques.pagey.site/

throwwwll an hour ago | parent [-]

Regardless of what these attacks exploit, see elsewhere a larping comment of mine: the solution exists, the implementation already mitigated numerous such and other exploits (it's nice to read "nix is not affected" on discourse or over matrix chat), it predates Docker by a decade, and is older than Ubuntu and Fedora (to give the perspective), yet people prefer to remain ignorant.

zitterbewegung an hour ago | parent [-]

You can have a security solution but with large ecosystems like this it can’t be pushed to the ecosystem immediately and everyone will take longer to test and deploy.

Right now you could audit packages and make sure you don’t get the latest version

kalcode 2 hours ago | parent | prev | next [-]

People make this joke often. It's package managers and how loose we are with installing them, not NPM.

Cargo,PyPi,Nuget,PHP has had these recent too.

It's not just only NPM. It's frequently repeated here just cause of the average bias against Node.

But this problem isn't isolated to NPM.

Defletter 2 hours ago | parent | next [-]

The problem is compounded with NPM though thanks to lifecycle scripts: yes, any and all package managers create a risk of supply-chain attack, but NPM makes it dangerous to merely open a project up in an IDE.

dns_snek an hour ago | parent | next [-]

> but NPM makes it dangerous to merely open a project up in an IDE.

It does not. Opening a project in an IDE has always been dangerous because there are about a thousand language server and analysis tools that run in the background. This is why IDEs ask you whether you trust the contents of a repository.

An even if some automated background execution initiated by the IDE doesn't get you, running `npm run test` 15 seconds later will.

okanat an hour ago | parent | prev | next [-]

It is the same for Crates.io and PyPI they also supply scripts without asking the user so opening an IDE will run them. For PyPI you need to even execute scripts to discover the dependencies!

kalcode an hour ago | parent | prev | next [-]

That's a good point. For me it's getting people to realize they need to take up practice that help minimize these things. It's kinda us and them problem.

We need to ensure we don't just blindly install the latest, patch every CVE by just bumping everything to the latest even if the vulnerability has nothing to do with their system or use of said library.

We should have rules that we install the latest that's older than three days.

We should be running "npm audit" and other stuff like Trivy.

The three day rule alone could save most people.

paulddraper 17 minutes ago | parent | prev | next [-]

Pip, Composer, RubyGems, NuGet, and several others have lifecycle scripts.

As of course do the OS managers -- apt, yum, Homebrew.

Kuinox an hour ago | parent | prev [-]

nuget have targets, and allow to run code on build, it doesn't have this problem because there is less dependencies.

philipwhiuk a minute ago | parent | prev | next [-]

In short, the problem is `npm` not NPM.

stingraycharles an hour ago | parent | prev | next [-]

How many package managers allow executing arbitrary code as part of the installation process by default?

latexr an hour ago | parent | prev [-]

> It's frequently repeated here just cause of the average bias against Node.

It’s frequently repeated here because NPM is where it keeps happening over and over and over and over and over and over again.

paulddraper 31 minutes ago | parent | prev | next [-]

Last 30 days:

PyPI, May 11. [1]

Crates.io, May 22 [2]

Composer, May 22 [3]

[1] https://www.tenable.com/blog/mini-shai-hulud-frequently-aske...

[2] https://socket.dev/blog/trapdoor-crypto-stealer-npm-pypi-cra...

[3] https://phoenix.security/laravel-lang-composer-supply-chain-...

latexr an hour ago | parent | prev | next [-]

There’s actually a blog post with that exact title.

https://kevinpatel.xyz/posts/no-way-to-prevent-this/

https://news.ycombinator.com/item?id=48155690

ajross 2 hours ago | parent | prev | next [-]

PyPI and Cargo are, 100%, vulnerable to this same class of compromises. That NPM sucks isn't a statement that everyone else doesn't.

TZubiri an hour ago | parent | prev | next [-]

tbf this is happening with a lot of package managers now, including pypi and composer

nailer an hour ago | parent | prev | next [-]

I've deleted and am rewriting this, to be more explicit, because HN downmodded the first comment to hell but I know I'm right and the crowd is wrong.

So, explicitly:

- pip

- Cargo

- apt/dpkg

- dnf/yum

- Homebrew

- RubyGems

- Composer (limited)

- Maven

...all allow scripts.

We understand the reference, it's just not correct: most package managers allow scripts, npm is the most successful package manager.

npm shouldn't allow scripts, but exploits happen everywhere.

krautsauer a minute ago | parent | next [-]

Are scripts even necessary? I don't think mvn has any form of scripts, but if the dependency is compromised, you're likely to execute whatever compromised code is in there the next time you do mvn verify (or whatever). Slightly less wormable maybe, running tests or at least checking whether your thing still runs after upgrading package versions is really common, no?

m4rtink 42 minutes ago | parent | prev | next [-]

If DNF/RPM is used there will often be a separate distro maintainer that should ideally review any changes coming from the upstream before pulling them into the distribution.

Also not all maintainers always pull in the latest upstream changes, only rebasing to new stable release or when the new features or fixes are actually needed for the distro stack.

Definitely not bulletproof but still IMHO more robust than "Lets just spray latest code from upstream without any review directly to production with a firehose!" that seems to be the norm.

xienze 29 minutes ago | parent | prev | next [-]

Maven does not run arbitrary scripts just by including a dependency.

matheusmoreira 30 minutes ago | parent | prev [-]

> HN downmodded the first comment to hell but I know I'm right and the crowd is wrong.

Got downvoted for saying it too. Don't let it discourage you.

matheusmoreira 2 hours ago | parent | prev | next [-]

All programming language package managers are vulnerable. They all have the exact same caveats as the Arch Linux User Repository. There are no trusted maintainers taking responsibility for things. Any random person can make an account and push packages.

saturn_vk 21 minutes ago | parent | next [-]

IIRC, go cannot run arbitrary code at build time, so that should not make it vulnerable

matheusmoreira 16 minutes ago | parent [-]

That changes nothing. If you're downloading packages pushed by randoms, then it's vulnerable. There is no escaping it. Go's module index is filled with people's GitHub repositories. You have no idea what's inside those things unless you review the source yourself.

myaccountonhn 44 minutes ago | parent | prev | next [-]

It's far far harder to do something exploits like this in elm because effects are tagged. There are solutions out there.

the__alchemist 2 hours ago | parent | prev | next [-]

I think this is a thought-terminating cliche, and false equivalences. Stating "This area where problems occur at a high rate is not a problem, as problems can happen elsewhere too" is a curt dismissal of a valid concern. It implies the course of action, rather than to address a high-problem area, is to ignore any solutions which aren't global, or equate it to lower-incidence areas.

You bring up a good point that this class of problem, or related ones can occur with other package managers. It was frustrating how long it took the Crates.io team (Rust manager) to address name squatting, in what appeared to be a "no perfect solution exists, so we won't act" line of reasoning.

matheusmoreira an hour ago | parent | next [-]

It was a reply to "only package manager where this regularly happens". Anyone who thinks it can't happen to them just because they're writing Python instead of Javascript is in for a world of hurt.

The comment I replied to is a literal meme. That's as charitable as it gets. Nothing "thought-terminating" about it.

kalcode 2 hours ago | parent | prev [-]

It's the exact same logic people used for Apple computers back in the day. The idea that Macs didn't get viruses because they were inherently more secure. But that wasn't true. It was purely a numbers game. Windows' popularity was so far off the charts that hackers naturally targeted Windows users instead of Mac users; it was just a better use of their time. The same thing is happening here. Other package managers do get compromised, but the sheer frequency of npm incidents just reflects how overwhelmingly popular Node.js and web apps are right now. JavaScript simply has a much higher usage rate than most other languages.

CBLT 2 hours ago | parent | prev | next [-]

Eh, it's worse than that. The GP comment is repeating a joke derived from an Onion headline about gun control. Where the very poignant message is about political will to make change. However, the npm ecosystem is very much willing and has already made several changes. If we're going to engage in discussion instead of meme-posting, the GP should have (imo) included real commentary _in addition to_ the meme they really wanted to post. What is the policy they want? Why do they see the NPM ecosystem as still resistant to change?

gbear605 an hour ago | parent | next [-]

One easy change would be that before any package can be published, it has to wait a minimum of two weeks in a state where it can be reviewed but it can't be installed without jumping through several hoops with big warning signs, things like "INSTALL_INTENTIONALLY_DANGEROUS_PACKAGES_THAT_WILL_BREAK_MY_COMPUTER=1", selecting yes in a dialogue that asks if they want to install software that likely has viruses, and pointing to a different package repository URL.

If there's some change that must get out sooner, then there can be some fee to pay to npm to have their security team do their own review.

Critically, there must be time for someone to review before it's the default to be selected.

I'm sure there are issues with this, this was off my head, but it seems like a really easy step to at least stem the problem for now. And there are a bunch of ideas like this that would help, but NPM doesn't seem willing to take it seriously as an existential threat to the ecosystem, rather than taking trivial steps.

matheusmoreira an hour ago | parent [-]

> where it can be reviewed

> Critically, there must be time for someone to review

By who? No one at npm is reviewing anything. "Someone" is doing a lot of work here.

Linux distributions have trusted maintainers who are responsible for their packages. People who cared enough to figure out PGP and set up an actual web of trust. That's where the verification happens. All these programming language package managers have nothing of the sort. PyPI, Rubygems, crates, npm, it doesn't matter. I can just make an account and push whatever I want.

These package managers are like this because that's what developers actually want. They don't want to deal with Linux distribution maintainers in order to get their software into the official repositories. They want to just run $packager push and have it out there with zero friction.

jauntywundrkind an hour ago | parent | prev [-]

They didn't back up their meme with real commentary because they have no real commentary to stand on:

They're spreading cheap disdain & scorn for npm ("only package manager" framing). But most other package management systems have similar abilities to run pretty un-sandboxed code.

TrapDoor has hit python, rust, and js repos. https://socket.dev/blog/trapdoor-crypto-stealer-npm-pypi-cra...

ajross 2 hours ago | parent | prev | next [-]

While true, tarring Arch here is a little unfair. AUR isn't enabled by default. It can't even be used via the same package front end, and in fact the "official" usage model requires that you clone the source yourself.

Indeed, AUR is bad as a software distribution mechanism (really it's best understood as a proving ground for baby packages before they get real maintainers and distro blessing), but it's less bad than NPM which puts the malware in the trusted/default/automated path.

matheusmoreira an hour ago | parent | next [-]

I'm not tarring Arch, I was praising it. I made sure to explicitly spell out the "User Repository". Arch is the one that does it right.

Ancapistani 2 hours ago | parent | prev [-]

I didn’t take it that way at all - rather, Arch is the only one that does it “right” with the AUR.

nailer an hour ago | parent [-]

If you want a usable system, you enable AUR. It's not 'doing it right', it's avoiding responsibility.

antiframe 25 minutes ago | parent [-]

Depends on who 'you' are. I have one package I installed from the AUR and it's from a corporation that just repackages their builds. The problem is always who vets the packages. I trust the Arch team and I trust that one corporation. Also to use the AUR it's a different command, so I can't get surprised by an AUR package. It's not a pacman -Syu is going to pull in a new unknown to me AUR package.

throwwwll 2 hours ago | parent | prev [-]

Nix enters the room.

(Everyone claps.)

junon an hour ago | parent | prev [-]

Please stop posting this on every single security incident thread with npm. It was funny once, it's just rehashing the same debate over and over.

da_chicken an hour ago | parent | next [-]

On the other hand, if the same problem keeps happening, it's hard to argue that the problem isn't foundational to the design and that it should be called out until either the problem is fixed or the design abandoned.

chipdale an hour ago | parent | prev | next [-]

Why should they stop? Maybe they want to rehash the issue that's not being adequately addressed. Maybe it's not supposed to be funny.

How do you propose we address this issue? Instead of policing what people say, are you interested in sharing your or someone else ideas?

junon an hour ago | parent [-]

It's not that there isn't a conversation to be had. It's that it's a low-effort, karma farming, reddit-tier comment that always invites emotional/reactionary responses, typically the same ones as before, that usually shoots to the top of the comments section and drowns out any relevant or interesting (see: curious, as per HN guidelines) discussion.

moi2388 33 minutes ago | parent [-]

Because policing other people’s comments instead of offering a solution isn’t a low-effort, reddit-tier comment?

Mirror. Buy one.

rectang an hour ago | parent | prev [-]

Opponents of gun control surely feel the same way about the Onion’s story.

dmix 2 hours ago | parent | prev | next [-]

Our company uses yarn 4 which has an option to prevent you from installing an npm package for the first number of days of its release. Most of these seem to be caught within that timeframe (1-3 days).

https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e...

mihaelm 38 minutes ago | parent | next [-]

`pnpm` also has that and it's on by default since `v11`:

https://pnpm.io/settings#minimumreleaseage

vinnymac 32 minutes ago | parent [-]

It’s on by default in yarn 4 too now, but pnpm was the first to market that default minimum gate.

https://github.com/yarnpkg/berry/pull/7135

iwhalen 2 hours ago | parent | prev | next [-]

uv supports the same for any Python developers out there: https://docs.astral.sh/uv/concepts/resolution/#dependency-co...

no-name-here 20 minutes ago | parent | next [-]

Sadly I haven't seen that Visual Studio/Rider/dotnet/Vs Code have such a feature for the c#/dotnet ecosystem.

KORraN an hour ago | parent | prev | next [-]

pip has recently added a similar option, i.e.

`pip install --uploaded-prior-to P7D pre-commit`

https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-upl...

darth_avocado 2 hours ago | parent | prev [-]

And somehow poetry doesn’t in 2026.

armanckeser an hour ago | parent | next [-]

I don't use poetry anymore but do check the updates before claiming such things

https://python-poetry.org/blog/announcing-poetry-2.4.0/

genxy 21 minutes ago | parent [-]

May 3rd 2026. Release too new, didn't read.

dist-epoch an hour ago | parent | prev [-]

so? nobody uses it anymore

darth_avocado 2 hours ago | parent | prev | next [-]

There is something to be said about the need to keep all the packages as the latest and the greatest at all times. Every minor version update doesn’t need to be immediately applied. And maybe high and critical vulnerabilities don’t need to be a minor version upgrade.

Waterluvian an hour ago | parent | next [-]

I’m having a real problem at work with security theatre and the growing push to obsess over numbers of “vulnerabilities” in our projects. And then auto Dependabot PRs that encourage churn to fix issues that if an informed person actually reviews easily concludes it doesn’t affect us in the slightest.

chrisweekly an hour ago | parent | prev [-]

"maybe high and critical vulnerabilities don’t need to be a minor version upgrade"

huh? what do you suggest instead?

darth_avocado an hour ago | parent [-]

A separate pathway to updates. At the moment there is a pressure to keep all the packages updated at all times. Every time a new version of a random package deep in the dependency tree gets published, you roll a dice: is it a bunch of bug fixes that I don’t care about or a vulnerability patch that need to apply immediately? Since it could be either most devs just auto pilot on updates. This creates an environment where newly introduced vulnerabilities get promoted rather quickly before the version matures. Sure, waiting a few days to update a package sounds great, but there is no guarantee that the vulnerability will be found quickly.

To give you a context, I get 20-30 PRs a week across all my repos with potentially hundreds of packages (non distinct) from dependabot. I give it a cursory look and try to get a summary of changes. Do I evaluate every single package update? Nope.

kylebebak 13 minutes ago | parent | prev | next [-]

npm supports this now as well, with e.g. `min-release-age=7` in `.npmrc`

olejorgenb 34 minutes ago | parent | prev | next [-]

pnpm also support this

dmix 32 minutes ago | parent [-]

The gist link above covers how to use it in yarn, npm, and pnpm

phoronixrly 2 hours ago | parent | prev [-]

What happens when everyone adopts this policy? You just change it to two weeks?

blm126 2 hours ago | parent | next [-]

The one week cooldown option is not relying on other users to be a canary for you. Its just giving automated scanners a chance to notice. This is the perfect example. I don't think step security found this by accident. They are actively monitoring NPM package releases at some level.

There is something to be said that Microsoft should be scanning packages pre-release. They aren't, though, so for right now there is a ton of value with very little downside if people implement a one week cooldown period.

To answer your question directly, though. If everyone else moves to a one week cooldown, I would absolutely suggest a two week cooldown is a good idea. Being the "slow" moving organization is a good security trade-off so long as you don't take it to extremes and have escape hatches when you actually need to be moving quickly.

phoronixrly an hour ago | parent [-]

Thank you for the thorough response. I got the following from yours and other responses:

* The JS ecosystem has been and will most likely continue to be fast-moving, so it's quite a safe assumption that at no point will a quarantine period be wide-spread.

* This quarantine period is for (semi-)automated scanners to catch the issue. Although considering the above there will always be a non-zero amount of end-user canaries as well.

* Maybe NPM should run scanners before distributing malware?

* If the ecosystem by any chance adopts a week-long quarantine period, you'd be safer if you applied a longer quarantine period.

_flux 15 minutes ago | parent [-]

> Maybe NPM should run scanners before distributing malware?

I suspect there's always a human checking these results. If NPM straight out rejects an update due to suspected malware, they might end up rejecting correct updates as well. If they grant some "safe" patterns a special pass, they might get exploited.

So I think this only works if you have security scanners that are well-maintained and kept in secret. NPM folks could of course co-operate with some security companies to have a first stab with the releases before they are put to public access. At some point some parties might start want to have monetary compensation for such an arragnement, though.

JoshTriplett 2 hours ago | parent | prev | next [-]

A large array of automated and semi-automated security scanners are finding things quickly. The main benefit of waiting before updating is to give those scanners time to work.

genxy 19 minutes ago | parent [-]

Would be nice if cargo had a cooldown flag and could respect lockfiles by default.

Ukv an hour ago | parent | prev | next [-]

Security scans and authors realizing an unauthorized version was pushed will generally happen regardless of whether regular users updated. Even for compromises that are found by users updating, it'd generally be better to reduce the number of people affected with a slow roll-out rather than everyone jumping on at once.

Tomte 2 hours ago | parent | prev | next [-]

You rely on the security companies scanning the packages.

exitb 2 hours ago | parent | next [-]

Well, if that actually works, it should be part of the release process, before the packages get placed onto the regular channels.

blm126 an hour ago | parent [-]

I think the key right now is that these are semi-automated scanning processes. Right now, companies like step security selectively publish. So, in order for a hacking group to find out if their malware is detected or not, they have to burn access to a useful package.

None of this is to say I think Microsoft shouldn't be doing something as part of the release process on NPM. However, there is real value in giving more independent third parties a window to do things semi-manually.

ZiiS an hour ago | parent | prev | next [-]

@exitb it is much more desirable for security scanning companies to compete to find issues in a timely manor. If npm blessed one as a gatekeeper to the whole system they would be between a rock and a hard place. Unable to priorities high impact packages over the long tail of packages no one uses without pissing people off. Unable to add experimental new detections that may be a little noisy at first due to the huge disruption it would cause. Be trivial to game as obscure packages could brute-force their way though then use the same hole on a mainstream package.

sandos an hour ago | parent | prev [-]

Then the ... malware will just add delays? Or do they really do manual in-depth analysis of all new code? Just running and seeing it do things is probably a lot easier.

Ukv 6 minutes ago | parent [-]

Security scanners won't be "manual in-depth analysis of all new code" or "Just running and seeing it do things", but somewhere in-between - utilizing static analysis/machine learning. It's a cat-and-mouse game, but the library adding code that waits X days to run something obfuscated would be another pattern that they could look for.

I think attackers are unlikely to add a delay in the first place because the chance of their attack being found out before it activates would be too high. They seem to generally work on the assumption that they have a day or so before the package is yanked (e.g: from maintainer noticing their account is compromised) so need to move fast.

BoredPositron 2 hours ago | parent | prev | next [-]

Always one day more than people on HN tell you. If something is compromised you will hear people complaining here that three days is not enough.

bakugo an hour ago | parent | prev [-]

This will never happen unless it's made the default. Most people will always stick with the defaults.

insanitybit an hour ago | parent | prev | next [-]

Just some suggestions:

1. Dependency cooldowns of 1-2 days seem to be extremely effective without negatively impacting your ability to patch for CVEs.

2. Anywhere you have `npm install` or `npm test` or anything where code executes, that should happen in an environment that has no privileges. In your github actions you can do this semi-straightforwardly by using two separate jobs - one to build the artifacts and test them, another to do any sort of publishing, signing, etc. If you use AI, add a skill / guidance to enforce this pattern.

3. If you use Github Actions, install the latest version of zizmor. It will significantly improve your posture.

(2) means that you are no longer "wormable", which is a massive part of the problem that we have today. (1) gives companies more time to respond to the attacks.

There are some vendors in this space that you can and should evaluate as well.

gbuk2013 2 hours ago | parent | prev | next [-]

I came across this interesting rant the other day: https://github.com/uNetworking/uWebSockets.js/blob/master/mi...

It does make sense that the right way would be to fork every dependency you use and install from your own repo reviewing and merging from upstream as needed. Would be a giant PITA though. :)

Bilal_io an hour ago | parent | next [-]

The problem would be the dependencies of your dependencies, and keep going many levels.

nafey 7 minutes ago | parent | next [-]

The problem is that node.js doesn't have a good standard library so one must rely on external packages to build even basic apps.

pipo234 an hour ago | parent | prev [-]

But presumably, you only include dependencies that you trust and those dependencies themselves do their trusting more strictly than you. Trust is built on vetting, signatures and reputation.

That is, at least what we do, in theory. In practice, we cross fingers and let the LLM pick dependencies, are satisfied if it just works and we either update our deps frequently or infrequently.

jruohonen 21 minutes ago | parent | next [-]

> Trust is built on vetting, signatures and reputation.

https://news.ycombinator.com/item?id=47017833

Well, now with an irony, but sadly, of course.

no-name-here 17 minutes ago | parent | prev [-]

Would red hat be considered a trusted/reputable vendor?

repelsteeltje an hour ago | parent | prev | next [-]

That might change the odds, but unless you fork diligently (and monkeypatch each and every future vulnerability) you might ship a compromised fork forever.

olejorgenb 33 minutes ago | parent [-]

Except most of the attacks so far has not landed actually source code changes to git IIRC. They have targeting the release files directly.

lights0123 29 minutes ago | parent [-]

Software vulnerabilities are often not placed maliciously, and are present in the original source. If you don't patch them if discovered later, you'll be vulnerable to them.

Cthulhu_ an hour ago | parent | prev | next [-]

Nothing that couldn't be automated; in Go land this is (arguably) called vendoring (https://go.dev/ref/mod#vendoring). Good to offload or reduce dependencies on 3rd party dependency hosters, pull a dependency into your own code review tools, and to ensure reproducible builds long term.

Izkata an hour ago | parent | next [-]

It's a generic and very old term for committing dependencies to your repo, it's not go-specific.

gbuk2013 an hour ago | parent | prev [-]

I mean there’s nothing stopping you from committing node_modules to git (after running something like https://github.com/timoxley/cruft on it) and reviewing code changes on dependency updates.

I even managed to make that part of the workflow on one team I worked with but several other teams since thought it was a crazy idea. :)

paulddraper 14 minutes ago | parent | prev | next [-]

The problem is the volume of dependencies. Most modern JavaScript, Python, Rust, Go, etc. projects have many dozens of transitive dependencies.

mbreese a few seconds ago | parent [-]

Let’s not ignore that dependencies are far more common in JS than any of those other languages. My Go projects generally only include a handful of external packages. Node projects on the other hand…

dboreham an hour ago | parent | prev | next [-]

I think the general idea that your supply chain should be rooted in source repositories and associated commit hashes is the right one. Tooling can be made to automate the process of putting together a product from those defined sources. Some languages/systems already have some support for this. E.g. Golang and Rust. The concept of a "binary" artifact is really dead now everyone uses git and builds are quick. It lives on in things like npm and docker hub but we don't actually need it.

twodave 2 hours ago | parent | prev [-]

For smaller shops (by small I mean <1,000 employees) this isn't even tenable. We (engineering team of about 10 people) mitigate what we can via tooling and cooldown periods/minimum release age. This will work as long as these malicious packages remain reasonably detectable. I think that's the proper balance, because we can adjust the # of days we are willing to risk against the SOTA of detection tooling.

_pdp_ 8 minutes ago | parent | prev | next [-]

Why blame on NPM? Would you blame GitLab if an opensource maintainer was hacked and as a result the repo contains malicious changes?

All of these recent incidents is just developers doing stupid things ... like using their compromised devices for making production changes, which is basically a big red flag to begin with.

In fact, the entire situation has been exacerbated by coding agents because now practically everything happens on a single device that touches hundreds of different production systems with full production credentials.

mellosouls an hour ago | parent | prev | next [-]

Should link to the original announcement I think:

https://www.stepsecurity.io/blog/multiple-redhat-cloud-servi...

nailer an hour ago | parent [-]

Yes. Also Red Hat is misspelt in the title.

kitd an hour ago | parent | prev | next [-]

Hmm, same day as RH and IBM announce Project Lightwell to help detect and fix supply chain vulns.

https://www.redhat.com/en/lightwell

lepuski 23 minutes ago | parent | prev | next [-]

Qubes offers the strongest protection against these threats. It's surprising it isn't more commonly adopted.

Sudhanshu2310 an hour ago | parent | prev | next [-]

We have done the complete analysis and there are 32 packages share the same publishing pipeline. https://safedep.io/redhat-cloud-services-hit-by-mini-shai-hu...

king_zee 2 hours ago | parent | prev | next [-]

I've made it a habit now to use the --before=2026-05-30 flag when installing packages, where it'll pick the version released before the date you specify, I usually pick around 5 days ago

t-sauer 22 minutes ago | parent | next [-]

If you use npm 11, you can simplify your workflow by setting min-release-age to 5. https://docs.npmjs.com/cli/v11/using-npm/config#min-release-...

mihaelm 42 minutes ago | parent | prev | next [-]

I just use `pnpm` and set up a liberal `minimumReleaseAge`: https://pnpm.io/settings#minimumreleaseage

Thankfully, it's on by default since v11.

sync 23 minutes ago | parent | prev | next [-]

If using straight npm (v11.10.0 or higher), you can just add to .npmrc in the project root:

min-release-age=5

sourcegrift an hour ago | parent | prev [-]

Yarn 4 can automate this

vinnymac 26 minutes ago | parent [-]

In case others are unaware, you just have to set https://yarnpkg.com/configuration/yarnrc#npmMinimalAgeGate to the value you want. It defaults to 1 day.

exabrial 19 minutes ago | parent | prev | next [-]

NPM broken by design. And the NIH syndrom that runs rampant in the community wont let them do anything simple.

ex-aws-dude 14 minutes ago | parent | prev | next [-]

Has anyone thought of having an agent review all dependency upgrades before upgrading?

I feel like that would at least catch some of these

voidUpdate an hour ago | parent | prev | next [-]

One thing I've never understood is why NPM allows packages to run code immediately after they are installed. What's the use case for that? A package should just be some code you can call on at runtime

tom1337 an hour ago | parent | next [-]

Some packages need to build native dependencies. sharp for example needs to build libvips on the system [0] to work

0: https://github.com/lovell/sharp/blob/main/install/build.js

vinnymac 22 minutes ago | parent [-]

I’ve always felt this automation shouldn’t exist at all, but should rather be selectively controlled via a hook. The hooks yarn offers out of the box for example can be used to run any code you need to after install. Putting the project owner in control instead of the dependency.

mark_l_watson 39 minutes ago | parent | prev [-]

I turn off running scripts on installation. So far, no inconveniences.

majorbugger 18 minutes ago | parent | prev | next [-]

I would like to meet the person behind the "postinstall scripts" idea and try to understand how they thought it was a good idea.

arianvanp 2 hours ago | parent | prev | next [-]

Given they use nx my bet is on developer laptop compromise through the nx vscode extension that also compromised GitHub engineer's laptop

dist-epoch an hour ago | parent [-]

the security of their packages should not depend on one laptop being compromised

rochak 38 minutes ago | parent | prev | next [-]

If this is what will take for folks to move away from JS ecosystem, I'll take it.

renox 20 minutes ago | parent [-]

Bah, I think that these kind of vulnerabilities exist in any "packaging ecosystem" where the base language offer "ambient authorities"(any library can access your filesystem) which is .. all of them! AFAIK only research languages do not provide these ambient authorities :-(

phishin 2 hours ago | parent | prev | next [-]

Chainguard based images, packages and libraries are first line of defense. Expensive? Yes. Foolproof? No. I think these types services will be mandatory in the near future.

dralley an hour ago | parent [-]

How would that help? These are not general purpose, base system libraries, these are libraries specific to a product that uses them. Either you're not using them and hence they would not be installed in the first place, or you're using them because you have the product installed.

Though I would expect that Insights uses RPM packages to ship components and not the public NPM packages.

SSLy an hour ago | parent [-]

it wouldn't surprise me if insights was in fact a wrapper around npm install

general_reveal 2 hours ago | parent | prev | next [-]

That’s why I switched to Java.

Rp8yXmdmr an hour ago | parent | next [-]

You are absolutely right. The dangerous part of NPM packages is the post-install script. Therefore moving from JavaScript to Java removes the threat.

keyle an hour ago | parent | prev | next [-]

    AbstractFinalFactoryShaiHuludSerialisedFactory
exabrial 22 minutes ago | parent | next [-]

https://dayssincelastjavascriptframework.com

general_reveal an hour ago | parent | prev [-]

Yeah but you don’t have to use that I think. I think us Node people can just pretend to write Ecmascript 2 in Java and be fine.

UqWBcuFx6NV4r an hour ago | parent | prev | next [-]

…. lol

mschuster91 an hour ago | parent | prev [-]

Meh maven plugins are just as juicy a target as npm is

exabrial 23 minutes ago | parent | next [-]

https://github.com/s4u/pgpverify-maven-plugin

If you want paranoid mode, you can verify literally every part of the maven build process.

general_reveal 36 minutes ago | parent | prev [-]

What do u recommend?

replwoacause 10 minutes ago | parent | prev | next [-]

It's becoming laughable how frequently this is happening. Wow.

indy 2 hours ago | parent | prev | next [-]

This is a completely unexpected turn of events that no one could have possibly foreseen.

Pxtl 11 minutes ago | parent | prev | next [-]

The combined features that make npm particularly vulnerable:

1) Update by default. Manually updating your package references is annoying and does lead to other security issues as you don't automatically get latest, but it makes this risk much lower.

2) Code executed on install. Statically-typed languages don't run the code until you use them, and that might not happen on the developer machine at all for first run after upgrade, it might be a lower-priv test-server.

3) Culture of many tiny modules (this is good! It's the natural way to fight NIH! Yay modularity!) means many more points-of-failure for security for this kind of attack.

grugdev42 an hour ago | parent | prev | next [-]

The joke is on you NPM! I only use CDNs for my JS libraries.

iconicBark 44 minutes ago | parent | next [-]

Is this more secure?? I would genuinely love to know

n_e 25 minutes ago | parent | next [-]

Yes (assuming they're doing frontend dev and including the resources from the page). The code is fetched and executed from the browser, so It'll have to escape the browser sandbox to do something nefarious.

bdcravens 38 minutes ago | parent | prev [-]

Yes, none of npm's lifecycle hooks. You're just pulling bytes over the wire.

runtime_terror 23 minutes ago | parent [-]

Except now you're making http calls to remote servers that could be compromised.

lostmsu 44 minutes ago | parent | prev [-]

Same. I came back to do a little frontend work a couple of years ago and was horrified by the replacement of script tags with subresource integrity with npm and bundlers.

paulbjensen 2 hours ago | parent | prev | next [-]

Looks like RedHat got compromised by a Black Hat…

anoncow 32 minutes ago | parent | prev | next [-]

This seems to be sinister

Havoc an hour ago | parent | prev | next [-]

The entire ecosystem is cursed

thewebguyd 26 minutes ago | parent [-]

Always has been. I remember poking fun at it 15+ years ago (queue the 'MongoDB is web scale' meme video).

kittikitti an hour ago | parent | prev | next [-]

I'm refactoring all my personal and research projects to utilize pure HTML/CSS without any dependency of JavaScript. This was always on the table but the cybersecurity risks from all programming languages and frameworks have increased due to AI.

I know of fundamental issues with JavaScript and see no reason why it's still standard on all web browsers.

rvz 2 hours ago | parent | prev | next [-]

This repository itself had to previously update from the axios supply chain attack [0] (co-authored by Claude lol). But just by looking at the change itself, the package is unpinned and won't solve the problem if another malicious security update happens again.

So if you have an unpinned version of this package and you run 'npm install', you immediately downloaded the compromised version and that's that.

[0] https://github.com/RedHatInsights/javascript-clients/commit/...

tetsgima an hour ago | parent | prev | next [-]

man we gotta do smth with preinstall hooks atp

bpavuk an hour ago | parent | prev | next [-]

Violence!

shrikant an hour ago | parent | prev | next [-]

Oooh now I'm wondering if this may have contributed to their Docker image distribution service getting disrupted earlier today... https://status.redhat.com/incidents/jn6r256zc62c

bobkb an hour ago | parent | prev | next [-]

When will npm issues stop ? This has become a big pain !

what_hn 2 hours ago | parent | prev | next [-]

Same actors again?

2OEH8eoCRo0 an hour ago | parent | prev | next [-]

Proof that we shouldn't worry about bad AI code and decisions because we have already been suffering from amateur JavaScript devs for at least 15 years.

m3kw9 2 hours ago | parent | prev | next [-]

At some point, they need a new system for these "packages", you've got to be insane to install any of these right now.

hsibenMohamed an hour ago | parent | prev | next [-]

Salam

freakynit 2 hours ago | parent | prev | next [-]

Lol.. yet again npm and install-scripts abuse at play.

Updated:

1. All exploitation techniques used since May 2025: https://npm-supply-chain-attack-techniques.pagey.site/

2. All attacks that happened since May 2025: https://npm-supply-chain-attacks-25-26.pagey.site/

MadrasTh0rn an hour ago | parent | prev | next [-]

Fucking Microsoft

buckle8017 2 hours ago | parent | prev | next [-]

Redhat's entire reason for existence is to prevent this.

cozzyd 44 minutes ago | parent | next [-]

did RPM packages get compromised?

dada216 an hour ago | parent | prev [-]

not really, no.

rob_c an hour ago | parent [-]

So why else do we pay someone to package and certify/verify open source projects? This is absolutely 90++% of what should be RedHats core day job.

duozerk 25 minutes ago | parent [-]

Non-profit Open Source distributions also and already package and verify open source packages (arguably often with a higher quality of analysis than Red Hat).

You pay red hat for compliance reasons (availability of a support you'll never call, mostly).

dist-epoch an hour ago | parent | prev [-]

if RedHat is unable to secure their packages, what can we expect from mere mortals...