Live data from Hacker News

Oh no, not again a meditation on NPM supply chain attacks

tane.dev

91–100 of 235 posts

Re: Oh no, not again a meditation on NPM supply chain attacks

#91
post #22
post #2

> The tools we use to build software are not secure by default, and almost all of the time, the companies that provide them are not held to account for the security of their products. The companies? More like the unpaid open source community volunteers who the Fortune 500 leech off contributing nothing in return except demands for free support, fixes and more features.

Per survey I read, majority of open source is created by people who are paid for it. The unpaid volunteer working full time on something is effectively a myth.

There are some mammoth projects where that's true, but the FOSS ecosystem has a very long tail where quite important and powerful libraries are maintained by individuals in their free time.

"unpaid volunteer working full time" also doesn't sound like something that someone would believe. Full time and unpaid rarely go together.

Re: Oh no, not again a meditation on NPM supply chain attacks

#92
Question for tanepiper: what would you have Microsoft do to improve things here?

My read of your article is that you don't like postinstall scripts and npx.

I'm not convinced that removing those would have a particularly major impact on supply chain attacks. The nature of npm is that it distributes code that is then executed. Even without npx, an attacker could still release an updated package which, when executed as a dependency, steals environment variables or similar.

And in the meantime, discarding box would break the existing workflows of practically every JavaScript-using developer in the world!

You mention 2FA. npm requires that for maintainers of the top 100 packages (since 2022), would you like to see that policy increased to the top 1,000/10,000/everyone? https://github.blog/security/supply-chain-security/top-100-n...

You also mention code signing. I like that too, but do you think that would have a material impact on supply chain attacks given they start with compromised accounts?

The investment I most want to see around this topic is in sandboxing: I think it should be the default that all code runs in a robust sandbox unless there is as very convincing reason not to. That requires investment that goes beyond a single language and package management platform - it's something that needs to be available and trustworthy for multiple operating systems.

Re: Oh no, not again a meditation on NPM supply chain attacks

#93
post #7

"No Way To Prevent This" Says Only Package Manager Where This Regularly Happens

"The issue is actually lack of guns, the way way to prevent this is by having more guns" kind of doubling down.

The issue is the people that use npm, and choose to have 48 layers of dependencies without paying for anything. Blaming microsoft, which is a company which pays engineers and audits all of its code and dependencies, is a step in the wrong direction in the necessary self reflection path off npm vulns.

Re: Oh no, not again a meditation on NPM supply chain attacks

#95
post #11

Anyone have a good solution to scan all code in our Github org for uses of the affected packages? Many of the methods we've tried have dead ended. Inability to reliably search branches is quite annoying here.

Any junior engineer should be able to solve this with grep in an afternoon.

Re: Oh no, not again a meditation on NPM supply chain attacks

#96
post #2

> The tools we use to build software are not secure by default, and almost all of the time, the companies that provide them are not held to account for the security of their products. The companies? More like the unpaid open source community volunteers who the Fortune 500 leech off contributing nothing in return except demands for free support, fixes and more features.

> More like the unpaid open source community volunteers who the Fortune 500 leech off contributing nothing in return except demands for free support, fixes and more features. People who work on permissively licensed software are donating their time to these Fortune 500 companies. It hardly seems fair to call the companies leeches for accepting these freely given donations.

It's not just time. A lot of devs simply don't have the experience of dogging into third party sourcing code or understanding how one contributed to open source.

Re: Oh no, not again a meditation on NPM supply chain attacks

#97

It's a stretch to pin blame on Microsoft. They're probably the reason the service is still up at all (TFA admits as much). In hindsight it's likely that all they wanted from the purchase was AI training material. At worst they're guilty of apathy, but that's no worse than the majority of npm ecosystem participants.

It’s NOT a stretch to blame Microsoft. How many billions have we spent chasing “AI”? These issues could have been easily solved if we spent the consideration on them. This has been going on well over a decade. Microsoft isn’t any better steward than the original teams. This issue has happened Plenty under Microsoft’s ownership.

i would contend that they are no worse than the original teams, who also clearly didn't care. their motivations may have been growth rather than AI training data but the outcomes were the same

Re: Oh no, not again a meditation on NPM supply chain attacks

#98
I see two ways to fight supply chain attacks:

* The endless arms race.

But, nevermind. It's been 2 years since Jia Tan and the amount of such 'occurrences' in the npm ecosystem in the past 10 years are bordering on uncountable at this point.

And yet this hack got through? This amateuristic and extremely obvious attempt? The injected function was literally named something like 'raidBitcoinEthWallet' or whatnot.

npm has clearly done absolutely nothing in this regard.

We haven't even gotten to the argument of '... but then hackers will simply use the automated tools themselves and only release stuff that doesn't get flagged'. There's nothing to talk about; npm has done nothing.

Which gets us to:

* Web of trust

This seems to me to be a near perfect way for the big companies that have earned so, so much money using the free FOSS they rely on, to contribute.

They spend the cash to hire a team that reviews FOSS stuff. Entire libraries, sure, but also updates. I think most of them _already do this_, and many will even openly publish issues they found. But they do not publish negative results (they do not publish 'our internal team had a quick look at update XYZ of project ABC and didn't see anything immediately suspicious').

They should start doing that. And repos like npm, maven, CPAN, etcetera should allow either the official maintainer of a library, or anybody, to attach 'assertments of no malicious intent'.

Imagine that npm hosts the following blob of text for NPM hosted projects in addition to the javascript artefacts:

> "I, google dev/security team, hereby vouch for this update in the senses: not-malicious. We have looked at it and did not see anything that we think is suspicious or worse. We make absolutely no promises whatsoever that this library is any good or that this update's changelog accurately represents the changes in it; we merely vouch for the fact that we do not think it was written with malicious intent. We explicitly disavow any legal or financial liability with this statement; we merely stake our good name. We have done this analysis on 2025-09-17 and did it for the artefact with SHA512 hash 1238498123abac. Signed, [public/private key infrastructure based signature, google.com].

And a general rule that google.com/.well-known/vouch-public-key or whatever contains the public key so anybody can check.

Aside from Jia Tan/xz (which always stops any attempt; Jia Tan/xz was so legendary, exactly how the fuck THIS still happens given that massive wakeup call boggles my mind!), every supply chain attack was pretty dang easy to spot; the problem was: Nobody was looking, and everybody configures their build scripts to pick up point updates immediately.

We should update these to 'pick them up after a certain 'vouch' score is reached'. Where everybody can mess with their scoring tables (don't trust google? reduce the value of their vouch to 0).

I think security-crucial 0day fixing updates will not be significantly hampered by this; generally big 0-days are big news and any update that comes out gets analysed to pieces. The vouch signatures would roll in within the hour after posting them.

Re: Oh no, not again a meditation on NPM supply chain attacks

#99
post #31

Earlier quoted context omitted.

What about cases when the update fixes a security issue? Anybody using this approach would be a target for a few more days.

I know it sounds preposterous but there there are more ways to apply patches than npm pull

Update package versions manually, you say? The audacity!

Re: Oh no, not again a meditation on NPM supply chain attacks

#100
post #62

It's a stretch to pin blame on Microsoft. They're probably the reason the service is still up at all (TFA admits as much). In hindsight it's likely that all they wanted from the purchase was AI training material. At worst they're guilty of apathy, but that's no worse than the majority of npm ecosystem participants.

> It's a stretch to pin blame on Microsoft. They're probably the reason the service is still up at all. I reckon that the ecosystem would have been much healthier if NPM had not been kept running without the care it requires.

I did wonder about that. Maybe yeah. It's likely that several no-better forks would have sprung up right away.
Post reply on HN