773 points by kurmiashish 5 days ago | 452 comments | View on ycombinator
eranation 5 days ago |
mnahkies 5 days ago |
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.
dmix 5 days ago |
https://gist.github.com/mcollina/b294a6c39ee700d24073c0e5a4e...
insanitybit 5 days ago |
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.
kitd 5 days ago |
gbuk2013 5 days ago |
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. :)
rectang 5 days ago |
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.
voidUpdate 5 days ago |
mellosouls 5 days ago |
https://www.stepsecurity.io/blog/multiple-redhat-cloud-servi...
kittikitti 5 days ago |
I know of fundamental issues with JavaScript and see no reason why it's still standard on all web browsers.
Pxtl 5 days ago |
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.
king_zee 5 days ago |
exabrial 5 days ago |
lepuski 5 days ago |
rochak 5 days ago |
Sudhanshu2310 5 days ago |
majorbugger 5 days ago |
Surac 5 days ago |
rvz 5 days ago |
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/...
indy 5 days ago |
greatgib 5 days ago |
Before, the source code was located somewhere, and the CI was usually located somewhere else, and slightly unrelated. At first, the CI job was to build ("privately") the artefacts, and they were manually released and deployed by maintainers and owner of software projects.
Then, it became the norm to have the CI located within the VCS file and the VCS located source code controlling the CI. For example having "script"/"description" of the CI actions located within the VCS itself.
Then, Github killed the CI/CD software market by offering "actions" almost for free and totally integrated within Github that was already widely used.
But still, for a long time people were wary to put tokens and security keys in Github and "public" CI/CD jobs and services.
And then, a few years ago, it became the gold standard also... You would look ridiculous to manually sign and deploy new releases with well guarded keys. What is expected from you is to have all your aws, github, ... secret api keys loaded in Github, and have your deployment and infrastructure provisioning automated with ("public") github accounts. All to be deployable in a second of a change being pushed.
So, obviously, the moment a hacker get control of a Github account or Github API keys, it is game over for the entire infrastructure.
Here I only referenced Github, but the bad things that it taught us became the norm and now these patterns are replicated everywhere (Gitlab, ...)
arianvanp 5 days ago |
general_reveal 5 days ago |
photon-torpedo 5 days ago |
Quote:
> The affected packages are frontend libraries that are compiled and bundled into some container images during the Red Hat product build process.
So you might be affected if you deployed any Red Hat container images built after the compromise, I guess. (I doubt anyone besides Red Hat is using the affected packages directly.)
cyphar 4 days ago |
The alternative proposal with "trusted" publishing is to grant all of GitHub's automated infrastructure the ultimate authority to publish things on your behalf automatically in a way that it is shown as being more "trusted" than the developer uploading it themselves! I'm honestly surprised that it took this long for supply-chain attackers to start targeting this obvious security hole -- I doubt any user of GitHub would argue that GitHub Actions are a parogon of security, and yet the strongly recommended deployment workflow for several language communities involved bolting it into the core of your release mechanisms! I think the OCID stuff is interesting and provides some nice properties but it doesn't prove that the GHA workload is actually trusted in the sense that "trusted publishing" means.
The arguments for adding speed bumps to auto-applying updates apply just as much to adding speed bumps to doing releases (arguably even more so -- even rapidly evolving libraries don't have hundreds of releases a week). Automating everything to the nth degree just expands the blast radius when stuff like this happens.
I do all runc releases manually and sign them with a PGP key stored in a hardware token that requires a pin for every signature attempt. Yes, it's a bit more cumbersome but it certainly would be harder to supply-chain hundreds of projects of every maintainer would need to manually publish them. For some other projects that need to publish to crates.io or PyPI I was honestly a little dismayed at how prominently they push for "trusted" publishing and how little support there is for making the "dumb" publishing flow more secure (they even visually display such releases as less trusted, and the only way to get more green checkmarks is to let GitHub take the wheel).
freakynit 5 days ago |
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/
quantumsicarius 5 days ago |
Also detonated the payload: https://leitwacht.eu/blog/valid-provenance-malicious-package
phishin 5 days ago |
czbond 5 days ago |
paulbjensen 5 days ago |
ffemac 5 days ago |
Setting min age is useless if everyone is doing it. The whole point of setting min age is make someone else take the bait before you.
bodash 5 days ago |
undefined 5 days ago |
undefined 5 days ago |
Havoc 5 days ago |
zeraye 5 days ago |
grugdev42 5 days ago |
undefined 5 days ago |
wg0 5 days ago |
kogasa240p 5 days ago |
m3kw9 5 days ago |
Noaidi 5 days ago |
obsidianbases1 5 days ago |
numron-dev 5 days ago |
replwoacause 5 days ago |
dist-epoch 5 days ago |
anoncow 5 days ago |
shrikant 5 days ago |
what_hn 5 days ago |
tetsgima 5 days ago |
buckle8017 5 days ago |
Escapade5160 5 days ago |
bobkb 5 days ago |
bpavuk 5 days ago |
jofzar 5 days ago |
Edit: some people don't understand that it's a defence to https://en.wikipedia.org/wiki/%27No_Way_to_Prevent_This,%27_...
bel8 5 days ago |
Oh dear. Here we go again.
ef2k 5 days ago |
MadrasTh0rn 5 days ago |
dennysora 4 days ago |
0x38B 5 days ago |
niros_valtos 5 days ago |
ajdaughe 5 days ago |
hirra 5 days ago |
calvinmorrison 5 days ago |
SadErn 5 days ago |
throwaway613746 5 days ago |
throwaway613746 5 days ago |
victorrpham 5 days ago |
hsibenMohamed 5 days ago |
ex-aws-dude 5 days ago |
I feel like that would at least catch some of these
_pdp_ 5 days ago |
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.
joshspankit 5 days ago |
It’s not even really the fault of the people who pushed for these setups, it’s a seemingly simple business decision: build it in a way that looks secure, add some black-box process, and tell the overseers that the reason there are no attacks is because it’s bulletproof, and definitely not because no one has really tried
Then, when someone finally turns their attention to you and walks in: fire whoever needs to be fired, patch that specific hole, maybe spend a bunch of money on a different system, assure the overseers that it’s handled, and move on with business as usual
It’s cheaper in the long-run, it makes stockholders happy, it relieves the bosses and their bosses, and for the most part there are “no security holes”.
Until now, of course
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)