News for hackers. Stuff that matters.
Re:Self Propagating NPM Malware Compromises over 40 Packages by btown on Tuesday September 16, 2025 @10:50AM (#45263089)
I'd like to think there are ways to do this and keep things decentralized.

Things like: Once a package has more than [threshold] daily downloads for an extended period of time, it requires 2FA re-auth/step-up on two separate human-controlled accounts to approve any further code updates.

Or something like: for these popular packages, only a select list of automated build systems with reproducible builds can push directly to NPM, which would mean that any malware injector would need to first compromise the source code repository. Which, to be fair, wouldn't necessarily have stopped this worm from propagating entirely, but would have slowed its progress considerably.

This isn't a "sacrifice all of NPM's DX and decentralization" question. This is "a marginally more manual DX only when you're at a scale where you should be release-managing anyways."

Re:Self Propagating NPM Malware Compromises over 40 Packages by noodlesUK on Tuesday September 16, 2025 @11:35AM (#45263691)
I think that we should impose webauthn 2fa on all npm accounts as the only acceptable auth method if you have e.g., more than 1 million total downloads.

Someone could pony up the cash to send out a few thousand yubikeys for this and we'd all be a lot safer.

Re:Self Propagating NPM Malware Compromises over 40 Packages by thewebguyd on Tuesday September 16, 2025 @12:04PM (#45264100)
Why even put a package download count on it? Just require it for everything submitted to NPM. It's not hard.
Re:Self Propagating NPM Malware Compromises over 40 Packages by ronsor on Tuesday September 16, 2025 @12:31PM (#45264470)
Because then it's extra hassle and expense for new developers to publish a package, and we're trying to keep things decentralized.
Re:Self Propagating NPM Malware Compromises over 40 Packages by kelnos on Tuesday September 16, 2025 @03:39PM (#45266931)
Decentralized? This is a centralized package registry. There is nothing decentralized about it.
Re:Self Propagating NPM Malware Compromises over 40 Packages by jay_kyburz on Tuesday September 16, 2025 @05:34PM (#45268419)
oh right, good point, I wonder when somebody will just sue NPM for any damage caused. That's really the only way we'll see change I think.
Re:Self Propagating NPM Malware Compromises over 40 Packages by thewebguyd on Tuesday September 16, 2025 @02:07PM (#45265686)
It's already centralized by virtue of using and relying on NPM as the registry.

If we want decentralized package management for node/javascript, you need to dump NPM - why not something like Go's system which is actually decentralized? There is no package repository/registry, it's all location based imports.

Re:Self Propagating NPM Malware Compromises over 40 Packages by LPisGood on Tuesday September 16, 2025 @02:51PM (#45266277)
I don’t understand what benefits this kind of “decentralization” offers
Re:Self Propagating NPM Malware Compromises over 40 Packages by q3k on Tuesday September 16, 2025 @03:49PM (#45267064)
Larger pool of people you can hack/blackmail/coerce into giving you access to millions of systems :)
Re:Self Propagating NPM Malware Compromises over 40 Packages by LtWorf on Tuesday September 16, 2025 @04:34PM (#45267621)
Download counters are completely useless. I could download your package 2 million times in under a minute and cause you to need the 2FA.

And true 2FA means you can't automate publishing from github's CI. Python is going the other direction. There is a fake 2FA that is just used to generate tokens and there is a preferential channel to upload to pypi via github's CI.

But in my opinion none of this helps with security. But it does help to de-anonymise the developers, which is probably what they really want to do, without caring if those developers get hacked and someone else uses their identity to do uploads.

Re:Self Propagating NPM Malware Compromises over 40 Packages by ForHackernews on Tuesday September 16, 2025 @01:35PM (#45265273)
PyPI already has this. It was a little bit annoying when they imposed stricter security on maintainers, but I can see the need.
Re:Self Propagating NPM Malware Compromises over 40 Packages by LtWorf on Tuesday September 16, 2025 @01:40PM (#45265343)
Pypi did that, i got 2 google keys for free. But I used them literally once, to create a token that never expires and that is what I actually use to upload on pypi.

(I did a talk at minidebconf last year in toulouse about this).

If implemented like this, it's completely useless, since there is actually no 2fa at all.

Anyway the idea of making libre software developers work more is a bad idea. We do it for fun. If we have to do corporate stuff we want a corporate salary to go with.

Re:Self Propagating NPM Malware Compromises over 40 Packages by kelnos on Tuesday September 16, 2025 @03:40PM (#45266948)
How would that work for CI release flows? I have my Rust crates, for example, set up to auto-publish whenever I push a tag to its repo.
Re:Self Propagating NPM Malware Compromises over 40 Packages by btown on Tuesday September 16, 2025 @04:32PM (#45267592)
Even the simplest "any maintainer can click a push notification on their phone to verify that they want to push an update to $package" would have stopped this worm in its tracks!
Re:Self Propagating NPM Malware Compromises over 40 Packages by LtWorf on Tuesday September 16, 2025 @01:37PM (#45265306)
> two separate human-controlled accounts to approve any further code updates.

Except most projects have 1 developer… Plus, if I develop some project for free I don't want to be wasting time and work for free for large rich companies. They can pay up for code reviews and similar things instead of adding burden to developers!