logoalt Hacker News

Malicious npm packages detected across Red Hat Cloud Services

626 pointsby kurmiashishtoday at 1:30 PM329 commentsview on HN

Comments

mnahkiestoday at 5:34 PM

In every of these threads there's a bunch of snarky comments, either acting like this class of attack is exclusive to npm, or that nothing has been done about it. I don't think that's fair.

There's plenty of comments mentioning delay lines, and the other good stuff pnpm (and others) have implemented in response to protect package consumers.

That bit that's getting less conversation is the tools on the package maintainer side:

- MFA for publishing: https://docs.npmjs.com/requiring-2fa-for-package-publishing-...

- trusted publishers, available for about a year: https://docs.npmjs.com/trusted-publishers

And as of recently, staged publishing, essentially combining the best of both those features: https://docs.npmjs.com/staged-publishing

Now you can: - Publish from CI, without static credentials

- AND require a maintainer to approve it using MFA before it actually goes live to the registry

If you want you can still use something like GitHub Actions Environments protection to require multiple approvals, or a time delay, on the CI side.

We need to encourage the community to adopt these publishing protections or this will continue to be an issue.

show 2 replies
eranationtoday at 3:31 PM

Hope it's ok I hijack this thread again about setting up cooldowns... (copy pasting my last comment when tanstack was compromised):

I know people have opinions about cooldowns, but they would have saved you from axios, tanstack, (+ @redhat-cloud-services) and many other recent npm supply chain attacks. If you have Artifactory / Nexus, you probably already have cooldowns, but it's easy to set up if you don't. Why cooldowns? Most npm (or pypi) compromises were taken down within hours, cooldowns simply mean - ignore any package with release date younger than N days (1 day can work, 3 days is ok, 7 days is a bit of an overkill but works too)

How to set them up?

- use latest pnpm, they added 1 day cooldown by default https://pnpm.io/supply-chain-security

- or if you want a one click fix, use https://depsguard.com (cli that adds cooldowns + other recommended settings to npm, pnpm, yarn, bun, uv, dependabot and, disclaimer: I’m the maintainer)

- or use https://cooldowns.dev which is more focused on, well, cooldowns, with also a script to help set it up locally

All are open source / free.

If you know how to edit your ~/.npmrc etc, you don't really need any of them, but if you have a loved one who just needs a one click fix, these can likely save them from the next attack.

Caveat - if you need to patch a new critical CVE, you need to bypass the cooldown, but each of them have a way to do so (described in detail in depsguard.com / cooldowns.dev) In the past few months, while I don't have hard numbers, it seems more risk has come from Software Supply Chain attacks (malicious versions pushed) than from new zero day CVEs (even in the age of Mythos driven vulnerability discovery)

show 4 replies
dmixtoday at 1:42 PM

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

show 8 replies
insanitybittoday at 2:38 PM

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.

show 3 replies
rectangtoday at 5:26 PM

About a week ago, I uninstalled Node from my laptop, which felt great. :)

I'm trying to do all work in dev containers (or other sandboxes), limiting the blast radius if I'm unlucky enough to be hit by an exploit. The attackers may get a Claude token, but they won't easily be able to escape the container and scan my home dir.

Cooldowns and allow-listing of installer scripts are good additions to layered security, especially for CI. However, I think the fundamental thing that needs to change is the OS permissions model. The default of trusting third-party software with everything your user has access is no longer workable.

gbuk2013today at 1:47 PM

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. :)

show 7 replies
kitdtoday at 2:11 PM

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

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

mellosoulstoday at 2:23 PM

Should link to the original announcement I think:

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

show 1 reply
lepuskitoday at 3:02 PM

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

king_zeetoday at 1:55 PM

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

show 4 replies
exabrialtoday at 3:06 PM

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

show 1 reply
majorbuggertoday at 3:06 PM

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

show 1 reply
voidUpdatetoday at 1:59 PM

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

show 2 replies
Suractoday at 3:45 PM

Npm is just borked by design. I hop it will take javascrip with it

Sudhanshu2310today at 1:55 PM

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

rochaktoday at 2:47 PM

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

show 4 replies
zerayetoday at 4:38 PM

There is some effort to make NPM more secure https://github.com/npm/cli/pull/9360.

indytoday at 1:44 PM

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

arianvanptoday at 1:46 PM

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

show 1 reply
general_revealtoday at 1:50 PM

That’s why I switched to Java.

show 4 replies
phishintoday at 1:54 PM

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.

show 1 reply
paulbjensentoday at 1:54 PM

Looks like RedHat got compromised by a Black Hat…

czbondtoday at 3:38 PM

Podman? Podman for OSX comes with a login item from "Red Hat, Inc". Anyone know how to check if this subcomponent utilizes these npms?

wg0today at 3:35 PM

Question - is there no way to catch these criminals?

show 1 reply
ex-aws-dudetoday at 3:11 PM

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

I feel like that would at least catch some of these

show 1 reply
Pxtltoday at 3:14 PM

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.

grugdev42today at 2:35 PM

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

show 2 replies
kogasa240ptoday at 3:49 PM

Throw the JS ecosystem into the sun at this point.

freakynittoday at 1:42 PM

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/

replwoacausetoday at 3:15 PM

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

tetsgimatoday at 2:13 PM

man we gotta do smth with preinstall hooks atp

Escapade5160today at 3:43 PM

Can someone give a tldr on why this happens so much with npm ? I can't recall seeing this with any other package manager. Is npm just the default used these days and therefore sees this more often?

anoncowtoday at 2:52 PM

This seems to be sinister

Havoctoday at 2:28 PM

The entire ecosystem is cursed

show 1 reply
kittikittitoday at 2:29 PM

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.

Noaiditoday at 4:02 PM

Human society, and our technology, is a fragile system built on our hubris, a cheap replacement for the Divine Eye of Providence.

rvztoday at 1:50 PM

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

shrikanttoday at 2:01 PM

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

what_hntoday at 1:47 PM

Same actors again?

bobkbtoday at 2:08 PM

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

bpavuktoday at 2:33 PM

Violence!

m3kw9today at 1:45 PM

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

bel8today at 3:37 PM

The XML extension I use in VSCode is by Red Hat.

Oh dear. Here we go again.

hsibenMohamedtoday at 2:33 PM

Salam

jofzartoday at 1:40 PM

'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_...

show 13 replies
dist-epochtoday at 2:25 PM

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

show 1 reply
buckle8017today at 1:41 PM

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

show 2 replies
MadrasTh0rntoday at 2:32 PM

Fucking Microsoft

🔗 View 8 more comments