Remix.run Logo
Meneth 5 hours ago

This happens because there's no auditing of new packages or versions. The distro's maintainer and the developer is the same person.

The general solution is to do what Debian does.

Keep a stable distro where new packages aren't added and versions change rarely (security updates and bugfixes only, no new functionality). This is what most people use.

Keep a testing/unstable distro where new packages and new versions can be added, but even then added only by the distro maintainer, NOT by the package developers. This is where the audits happen.

NPM, Python, Rust, Go, Ruby all suffer from this problem, because they have centralized and open package repositories.

btown 3 hours ago | parent | next [-]

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

noodlesUK 2 hours ago | parent [-]

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.

ForHackernews 2 minutes ago | parent | next [-]

PyPI already has this. It was a little bit annoying when they imposed stricter security on maintainers, but I can see the need.

thewebguyd 2 hours ago | parent | prev [-]

Why even put a package download count on it? Just require it for everything submitted to NPM. It's not hard.

ronsor an hour ago | parent [-]

Because then it's extra hassle and expense for new developers to publish a package, and we're trying to keep things decentralized.

LtWorf a few seconds ago | parent | prev | next [-]

> The general solution is to do what Debian does.

If you ask these people, distributions are terrible and need to die.

Python even removed PGP signatures from Pypi because now attestation happens by microsoft signing your build on the github CI and uploading it directly to pypi with a never expiring token. And that's secure, as opposed to the developer uploading locally from their machine.

In theory it's secure because you see what's going in there on git, but in practice github actions are completely insecure so malware has been uploaded this way already.

weinzierl 5 hours ago | parent | prev | next [-]

In Rust we have cargo vet, where we share these audits and use them in an automated fashion. Companies like Google and Mozilla contribute their audits.

quotemstr 4 hours ago | parent [-]

And it's a great idea, similar thematically to certificate transparency

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

You can use debian's version of your npm packages if you'd like. The issues you're likely to run into are: some libraries won't be packaged period by debian; those that are might be on unacceptably old versions. You can work around these issues by vendoring dependencies that aren't in your distro's repo, ie copying a particular version into your own source control, manually keeping up with security updates. This is, to my knowledge, what large tech companies do. Other companies that don't are either taking a known risk with regards to vulnerabilities, or are ignorant. Ignorance is very common in this industry.

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

> NPM, Python, Rust, Go, Ruby all suffer from this problem, because they have centralized and open package repositories

Can you point me to Go's centralized package repository?

ForHackernews a minute ago | parent [-]

https://github.com/

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

There is another related growing problem in my recent observation. As a Debian Developer, when I try to audit upstream changes before pulling them in to Debian, I find a huge amount of noise from tooling, mostly pointless. This makes it very difficult to validate the actual changes being made.

For example, an upstream bumps a version of a lint tool and/or changes style across the board. Often these are labelled "chore". While I agree it's nice to have consistent style, in some projects it seems to be the majority of the changes between releases. Due to the difficulty in auditing this, I consider this part of the software supply chain problem and something to be discouraged. Unless there's actually reason to change code (eg. some genuine refactoring a human thinks is actually needed, a bug fix or new feature, a tool exposed a real bug, or at least some identifiable issue that might turn into a bug), it should be left alone.

kirici 22 minutes ago | parent [-]

I'm using difftastic, it cuts down a whole lot of the noise

https://difftastic.wilfred.me.uk/

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

So, who is going to audit the thousands of new packages/versions that are published to npm every day? It only works for Debian because they hand-pick popular software.

rixed 4 hours ago | parent | prev | next [-]

Exactly, in a way Debian (or any other distro) is an extended standard library.

stinos 3 hours ago | parent | prev | next [-]

security updates and bugfixes only

Just wondering: while this is less of an attack surface, it's still a surface?

SkiFire13 3 hours ago | parent | prev | next [-]

> Keep a stable distro where new packages aren't added and versions change rarely (security updates and bugfixes only, no new functionality). This is what most people use.

Unfortunately most people don't want old software that doesn't support newer hardware so most people don't end up using Debian stable.

veber-alex an hour ago | parent | next [-]

I don't know why you went with hardware.

Most people don't want old software because they don't want old software.

They want latest features, fixes and performance improvements.

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

What hardware isn't supported by Debian stable that is supported by unstable?

Or is this just a "don't use Linux" gripe?

lenerdenator 2 hours ago | parent | prev [-]

It'd be interesting to see how much of the world runs on Debian containers, where most of the whole "it doesn't support my insert consumer hardware here" argument is completely moot.

paulddraper 3 hours ago | parent | prev | next [-]

Go’s package repository is just GitHub.

At the end of the day, it’s all a URL.

You’re asking for a blessed set of URLs. You’d have to convince someone to spend time maintaining that.

Maskawanian 33 minutes ago | parent | next [-]

Golang at least gives you the option to easily vendor-ize packages to your local repository. Given what has happened here, maybe we should start doing this more!

mdaniel 3 hours ago | parent | prev [-]

As hair splitting, that's actually not true: Go's package manager is just version control of which GitHub is currently the most popular hosting. And it also allows redirecting to your own version control via `go mod edit -replace` which leaves the sourcecode reference to GitHub intact, but will install it from wherever you like

thunky an hour ago | parent [-]

How does that relate to the bigger conversation here? Are you suggesting people stop pulling Go packages from GitHub and only use local dependencies?

hombre_fatal 3 hours ago | parent | prev | next [-]

The problem with your idea is that you need to find the person who wants to do all this auditing of every version of Node/Python/Ruby libraries.

carlhjerpe 2 hours ago | parent [-]

I believe good centralized infrastructure for this would be a good start. It could be "gamified" and reviewers could earn reputation for reviewing packages, common packages would be reviewed all the time.

Kinda like Stackoverflow for reviews, with optional identification and such.

And honestly an LLM can strap a "probably good" badge on things with cheap batch inference.

Aeolun 5 hours ago | parent | prev [-]

> suffer from this problem

Benefit from this feature.