News for hackers. Stuff that matters.
Re:Self Propagating NPM Malware Compromises over 40 Packages by ncruces on Tuesday September 16, 2025 @02:32PM (#45266032)
This is a culture issue with developers who find it OK to have hundreds of (transitive) dependencies, and then follow processes that, for all intents and purposes, blindly auto update them, thereby giving hundreds of third-parties access to their build (or worse) execution environments.

Adding friction to the sharing of code doesn't absolve developers from their decision to blindly trust a ridiculous amount of third-parties.

Re:Self Propagating NPM Malware Compromises over 40 Packages by Pet_Ant on Tuesday September 16, 2025 @03:41PM (#45266951)
I find that the issue is much more often not updating dependencies often enough with known security holes, than updating too often and getting hit with a supply-chain malware attack.
Re:Self Propagating NPM Malware Compromises over 40 Packages by sgc on Tuesday September 16, 2025 @04:00PM (#45267211)
There have been several recent supply chain attacks that show attackers are taking advantage of this (previously sensible) mentality. So it is time to pivot and come up with better solutions before it spirals out of control.
Re:Self Propagating NPM Malware Compromises over 40 Packages by IgorPartola on Tuesday September 16, 2025 @06:45PM (#45269252)
A model that Linux distros follow would work to an extent: you have developed of packages and separate maintainers who test and decide to include or exclude packages and versions of packages. Imagine a JS distro which includes the top 2000 most popular libraries that are all known to work with each other. Your project can pull in any of these and every package is cryptographically signed off on by both the developers and the maintainer.

Vulnerabilities in Linux distro packages obviously happen. But a single developer cannot push code directly into for example Debian and compromise the world.

Re:Self Propagating NPM Malware Compromises over 40 Packages by dboreham on Tuesday September 16, 2025 @04:11PM (#45267342)
Not updating is the other side of the same problem: library owners feel it is ok to make frequent backwards-compatibility breaking changes, often ignoring semver conventions. So consumers of their libraries are left with the choice to pin old insecure versions or spend time rewriting their code (and often transitive dependency code too) to keep up.

This is what happens when nobody pays for anything and nobody feels they have a duty to do good work for free.

Re:Self Propagating NPM Malware Compromises over 40 Packages by banku_brougham on Tuesday September 16, 2025 @04:33PM (#45267611)
>This is what happens when nobody pays for anything and nobody feels they have a duty to do good work for free.

Weirdly, some of the worst CVE I can think of were with enterprize software.

Re:Self Propagating NPM Malware Compromises over 40 Packages by zelphirkalt on Tuesday September 16, 2025 @04:58PM (#45267964)
That's because there many people don't feel like it is their duty to do good work, even though they are paid ...
Re:Self Propagating NPM Malware Compromises over 40 Packages by jand on Wednesday September 17, 2025 @04:34AM (#45273322)
Who do you mean with "many people"? Developers who do not care or middle management that oversold features and overcommitted w.r.t. deadlines? Or both? Someone else?
Re:Self Propagating NPM Malware Compromises over 40 Packages by zelphirkalt on Wednesday September 17, 2025 @06:35AM (#45274069)
I was thinking of many developers, but actually middle management should be included.
Re:Self Propagating NPM Malware Compromises over 40 Packages by cutemonster on Thursday September 18, 2025 @08:14PM (#45296553)
And the CEO. And lawmakers
Re:Self Propagating NPM Malware Compromises over 40 Packages by rectang on Tuesday September 16, 2025 @03:49PM (#45267066)
It's not unreasonable to trust large numbers of trustworthy dependency authors. What we lack are the institutions to establish trust reliably.

If packages had to be cryptographically signed by multiple verified authors from a per-organization whitelist in order to enter distribution, that would cut down on the SPOF issue where compromising a single dev is enough to publish multiple malware infested packages.

Re:Self Propagating NPM Malware Compromises over 40 Packages by dboreham on Tuesday September 16, 2025 @04:12PM (#45267357)
Problem is that beyond some threshold number of authors, the probability they're all trustworthy falls to zero.
Re:Self Propagating NPM Malware Compromises over 40 Packages by rectang on Tuesday September 16, 2025 @04:22PM (#45267458)
It's true that smuggling multiple identities into the whitelist is one attack vector, and one reason why I said "cut down" rather than "eliminate". But that's not easy to do for most organizations.

For what it's worth, back when I was active at the ASF we used to vote on releases — you needed at least 3 positive votes from a whitelist of approved voters to publish a release outside the org and there was a cultural expectation of review. (Dunno if things have changed.) It would have been very difficult to duplicate this NPM attack against the upstream ASF release distribution system.

Re:Self Propagating NPM Malware Compromises over 40 Packages by WesolyKubeczek on Tuesday September 16, 2025 @05:10PM (#45268097)
"Find large numbers of trustworthy dependency authors in your neighborhood!"

"Large numbers of trustworthy dependency authors in your town can't wait to show you their hottest code paths! Click here for educational livecoding sessions!"

Re:Self Propagating NPM Malware Compromises over 40 Packages by rectang on Tuesday September 16, 2025 @07:54PM (#45269857)
I don't understand your critique.

Establishing a false identity well enough to fool a FOSS author or organization is a lot of work. Even crafting a spear phishing email/text campaign doesn't compare to the effort you'd have to put in to fool a developer well enough to get offered publishing privileges.

Of course it's possible, but so are beat-them-with-a-five-dollar-wrench attacks.

Re:Self Propagating NPM Malware Compromises over 40 Packages by jitix on Tuesday September 16, 2025 @10:30PM (#45270906)
It IS unreasonable to trust individual humans across the globe in 100+ different jurisdictions pushing code that gets bundled into my application.

How can you guarantee a long trusted developer doesn't have a gun pointed to their head by their authoritarian govt?

In our B2B shop we recently implemented a process where developers cannot add packages from third party sources - only first party like meta, google, spring, etc are allowed. All other boilerplate must be written by developers, and on the rare occasion that a third party dependency is needed it's copied in source form, audited and re-hosted on our internal infrastructure with an internal name.

To justify it to business folks, we presented a simple math where I added the man-hours required to plug the vulnerabilities with the recurring cost of devsecops consultants and found that it's cheaper to reduce development velocity by 20-25%.

Also devsecops should never be offshored due to the scenario I presented in my second statement.

Re:Self Propagating NPM Malware Compromises over 40 Packages by rectang on Tuesday September 16, 2025 @10:55PM (#45271074)
You've presented your argument as if rebutting mine, but to my mind you've reinforced my first paragraph:

* You are trusting large numbers of trustworthy developers.

* You have established a means of validating their trustworthiness: only trust reputable "first-party" code.

I think what you're doing is a pretty good system. However, there are ways to include work by devs who lack "first-party" bona-fides, such as when they participate in group development where their contributions are consistently audited. Do you exclude packages published by the ASF because some contributions may originate from troublesome jurisdictions?

In any case, it is not necessary to solve the traitorous author problem to address the attack vector right in front of us, which is compromised authors.

Re:Self Propagating NPM Malware Compromises over 40 Packages by user34283 on Wednesday September 17, 2025 @06:26AM (#45274000)
If someone is wondering how effective such an approach is going to be with npm, consider the following:

If you add jest, the popular test runner by Meta, that's adding 300 packages to your dependency graph.

And here we don't yet have a bundler, linter, code formatter, or even web framework.

So good luck with minimizing those dependencies.

Re:Self Propagating NPM Malware Compromises over 40 Packages by the8472 on Tuesday September 16, 2025 @03:59PM (#45267203)
Rather than adding friction there is something else that could benefit from having as little friction as sharing code: publishing audits/reviews.
Re:Self Propagating NPM Malware Compromises over 40 Packages by computerex on Tuesday September 16, 2025 @03:44PM (#45267014)
Be that as it may, a system that can fail catastrophically will. Security shouldn't be left to choice.
Re:Self Propagating NPM Malware Compromises over 40 Packages by zwnow on Tuesday September 16, 2025 @03:35PM (#45266877)
Unfortunately that's almost the whole industry. Every software project I've seen has an uncountable amount of dependencies. No matter if npm, cargo, go packages, whatever you name.
Re:Self Propagating NPM Malware Compromises over 40 Packages by AnonymousPlanet on Tuesday September 16, 2025 @03:51PM (#45267089)
Every place I ever worked at made sure to curate the dependencies for their main projects. Heck, in some cases that was even necessary for certifications. Web dev might be a wild west, but as soon as your software is installed on prem by hundreds or thousands of paying customers the stakes change.
Re:Self Propagating NPM Malware Compromises over 40 Packages by zwnow on Tuesday September 16, 2025 @03:57PM (#45267178)
Curating dependencies won't prevent all supply chain attacks though
Re:Self Propagating NPM Malware Compromises over 40 Packages by jen20 on Tuesday September 16, 2025 @04:27PM (#45267512)
Zero-external-dependency Go apps are far more feasible than Rust or Node, simply because of the size and quality of the standard library.
Re:Self Propagating NPM Malware Compromises over 40 Packages by ncruces on Tuesday September 16, 2025 @04:59PM (#45267969)
Just the other day someone argued with me that it was reasonable for Limbo (the SQLite Rust rewrite) to have 3135 dependencies (of those, 1313 Rust dependencies).

https://github.com/tursodatabase/turso/network/dependencies

Re:Self Propagating NPM Malware Compromises over 40 Packages by whstl on Tuesday September 16, 2025 @05:49PM (#45268596)
This is incredible.

At this rate, there's a non-zero chance that one of the transitive dependencies is SQLite itself.

Re:Self Propagating NPM Malware Compromises over 40 Packages by wolvesechoes on Wednesday September 17, 2025 @03:42AM (#45272993)
But it will be safe SQlite, called from Rust.
Re:Self Propagating NPM Malware Compromises over 40 Packages by Meneth on Wednesday September 17, 2025 @09:05AM (#45275371)
3 different types of sqlite, 14 different versions total: https://github.com/tursodatabase/turso/network/dependencies?...
Re:Self Propagating NPM Malware Compromises over 40 Packages by aw1621107 on Wednesday September 17, 2025 @01:01PM (#45278442)
Looks like they're all pulled in as dev dependencies. libsqlite3-sys gets pulled in by rusqlite, which is used by core_tester, limbo_sim, write-throughput-sqlite, and as a dev_dependency for turso_core.
Re:Self Propagating NPM Malware Compromises over 40 Packages by Ygg2 on Tuesday September 16, 2025 @09:00PM (#45270283)
Yeah. You have dev dependencies in there, those alone will increase number of dependencies by ~500, without ending up in the final product.

Those numbers are way off their actual number.

Re:Self Propagating NPM Malware Compromises over 40 Packages by what on Tuesday September 16, 2025 @11:31PM (#45271323)
500 dev dependencies doesn’t seem reasonable either…
Re:Self Propagating NPM Malware Compromises over 40 Packages by zwnow on Wednesday September 17, 2025 @02:20AM (#45272401)
Even 50 seems unreasonable...
Re:Self Propagating NPM Malware Compromises over 40 Packages by ncruces on Wednesday September 17, 2025 @02:30AM (#45272468)
Right. Allowing 500 strangers to push code to our CI infra, or developer laptops, with approximately zero review, sounds similarly ill advised.

That JLR got their factories hacked, rather than customer cars, is less bad for sure. But it's still pretty bad.

Also, before arguing that code generators should get a pass as they don't “end up in the final product”, you really should read “Reflections on trusting trust” by Ken Thompson.

Re:Self Propagating NPM Malware Compromises over 40 Packages by Ygg2 on Wednesday September 17, 2025 @04:16AM (#45273212)
> Right. Allowing 500 strangers to push code to our CI infra

That's bullshit, pure and simple. If you pull in a deeply nested dependency like icu_normalizer it has 30 dependencies, OMGHAXOZRS.

Except of the 30 depedencies crates, there are 10 from ICUX repository, and then you have almost standard dependencies like proc-macro/syn/quote crates from dtolnay, `zerofrom` from safe transumte project from Google. smallvec from the Servo project, and yoke from... checks notes... from ICUX.

The only few remaining crates here are `write16`, `utf8_iter` and `utf16_iter` that are written from hsivonen.

So even for 30 dependencies, you actually depend on proc-macro/syn/quote which are foundational crates. Few crates from Google, few crates from Servo, and three crates written by rust-lang contributor.

Re:Self Propagating NPM Malware Compromises over 40 Packages by ncruces on Wednesday September 17, 2025 @04:43AM (#45273391)
It's great that you did that due diligence once. It really is. If I were reviewing that merge request, and you told me that, I'd be inclined to approve.

But how do we scale that to 1000 dependencies, and every one of their updates? What tools are there to help us, and does the community at large use them?

What I really don't like, and why I wrote that it's a culture issue, is the lightness with which these decisions are often made.

My most popular library has about a dozen dependencies. The README states clearly and “above the fold” what are the core deps (3, no transitive). Every other dependency is either first party, or optional and justified with a comment in the deps file (if you don't use the optional feature, it doesn't end up in your deps file).

There's also a generated BLOB. The generation of the BLOB is reproducible in your own environment, and its provenance attestated.

Those are all risks, that I'm passing on to my users, but I do my best to mitigate them, and communicate this clearly to them.

Re:Self Propagating NPM Malware Compromises over 40 Packages by Ygg2 on Thursday September 18, 2025 @09:27AM (#45289437)
> But how do we scale that to 1000 dependencies, and every one of their updates? What tools are there to help us, and does the community at large use them?

Use

    cargo install cargo-supply-chain
    cargo supply-chain --publishers
Run it for whatever you want to check, then have a lunch, it takes 10-30min.

It will list exactly how many organizations, and even individuals with publish rights are there. For turso there are 51 repositories, and 243 different individuals with publish rights.

Of course, this still doesn't group by github org and so on.

Re:Self Propagating NPM Malware Compromises over 40 Packages by Etherlord87 on Wednesday September 17, 2025 @05:17AM (#45273569)
Sorry, I don't know much about the subject, so this is not a rhetorical or even just loaded question:

Isn't it actually the case that you started with 3 strangers, but 27 of them were relatively easy (still took some time) to figure out as safe?

Re:Self Propagating NPM Malware Compromises over 40 Packages by Ygg2 on Wednesday September 17, 2025 @09:13AM (#45275437)
You have 30 items you bought from various stores. You bought ~20 from yourself, around 5 from Google, 4 from hsivonen and one from servo.

You could of course investigate individuals commits, but that's probably an overkill.

Re:Self Propagating NPM Malware Compromises over 40 Packages by ricardobeat on Wednesday September 17, 2025 @03:55AM (#45273091)
Even more wild considering that SQLite prides itself on having zero dependencies. Sounds like a doomed project.
Re:Self Propagating NPM Malware Compromises over 40 Packages by zelphirkalt on Tuesday September 16, 2025 @04:56PM (#45267940)
See auto update bots on Github. https://docs.github.com/en/code-security/dependabot/dependab... And since Github does it, it must be a good thing, right? Right???
Re:Self Propagating NPM Malware Compromises over 40 Packages by worik on Tuesday September 16, 2025 @04:56PM (#45267944)
> This is a culture issue with developers who find it OK to have hundreds of (transitive) dependencies, and then follow processes that, for all intents and purposes, blindly auto update them

I do not know about NPM. But in Rust this is common practice.

Very hard to avoid. The core of Rust is very thin, to get anything done typically involves dozens of crates, all pulled in at compile time from any old developer implicitly trusted.

Re:Self Propagating NPM Malware Compromises over 40 Packages by hedora on Tuesday September 16, 2025 @08:11PM (#45269970)
The same is true for go and for java.
Re:Self Propagating NPM Malware Compromises over 40 Packages by ricardobeat on Wednesday September 17, 2025 @03:59AM (#45273120)
You can write entire applications in Go without resorting to any dependencies, the std lib is quite complete.

Most projects will have a healthy 5-20 dependencies though, with very little nested modules.

Re:Self Propagating NPM Malware Compromises over 40 Packages by fennecfoxy on Friday September 19, 2025 @12:06PM (#45303254)
>absolve developers

Doesn't this ultimately go all the way up to the top?

You have 2 devs: one who mostly writes their own code, only uses packages that are audited etc; the other uses packages willy nilly. Who do you think will be hired? Who do you think will be able to match the pace of development that management and executives demand?