Re:NPM package event-source-polyfill compromised by politica...
by ramesh31 on Friday April 08, 2022 @07:08PM
(#30963601)
I was digging through node_modules today and almost had a heart attack. We are running this code across millions of users right now.
[ Parent
| on HN ]
Re:NPM package event-source-polyfill compromised by politica...
by throw_m239339 on Friday April 08, 2022 @08:02PM
(#30963941)
Did you ever audit the code in that package or read the source at least once?
Re:NPM package event-source-polyfill compromised by politica...
by jackconsidine on Friday April 08, 2022 @08:20PM
(#30964046)
That's a tremendous expectation. There are 913 node_modules in the first project I glanced at. That's millions of lines of code.... More than one person can reasonably audit even if it's their full-time job. Where would this responsibility end? Should they also be auditing Node.JS source code? And nightly browser builds? No, we necessarily federate our trust at some point in these things being raised by others (like now, albeit 23 days late).
Re:NPM package event-source-polyfill compromised by politica...
by JohnHaugeland on Saturday April 09, 2022 @11:23AM
(#30968823)
It seems like you're attempting to suggest that third party javascript is on equal trust footing with major tools and things by international corporations
Re:NPM package event-source-polyfill compromised by politica...
by jackconsidine on Sunday April 10, 2022 @04:45PM
(#30981529)
My point was that it's unreasonable to expect the exhaustive audit of all node modules. That said, "major tools and things by international corporations" like Gatsby depend on the topic library [0].
Re:NPM package event-source-polyfill compromised by politica...
by pabs3 on Friday April 08, 2022 @11:15PM
(#30965003)
There is a distributed code review system that is intended to make it feasible to do the necessary review:
Re:NPM package event-source-polyfill compromised by politica...
by exfascist on Friday April 08, 2022 @09:46PM
(#30964555)
I don't run nigtly browser builds because that's too much to keep up with. I have actually read quite a bit of the code for the browser I use. I read almost everything I deploy because I'm responsible for it. Using other people's code absolves you from maintenance but not responsibility, that's something people need to start understanding. It's a very reasonable expectation that you read through your dependencies, if it's too much then it's time to trim some fat.
Re:NPM package event-source-polyfill compromised by politica...
by Alcha on Friday April 08, 2022 @08:12PM
(#30963990)
I feel like this question has good intentions but comes across wrong. It's virtually impossible to audit literally every nested dependency.
Re:NPM package event-source-polyfill compromised by politica...
by the8472 on Friday April 08, 2022 @08:18PM
(#30964032)
Depends on how much the company values (i.e. is paying for) that supply chain security. And if enough companies cared they could even save money by pooling efforts.
Re:NPM package event-source-polyfill compromised by politica...
by pabs3 on Friday April 08, 2022 @11:16PM
(#30965007)
The crev folks aim to create a tool to allow that pooling:
Re:NPM package event-source-polyfill compromised by politica...
by yjftsjthsd-h on Friday April 08, 2022 @08:51PM
(#30964247)
If nobody can audit the dependency tree, should you really be using it?
Re:NPM package event-source-polyfill compromised by politica...
by adamscybot on Friday April 08, 2022 @08:56PM
(#30964276)
"Depends". The benefits of leaning on open source pays off the majority of the time. Are you exposed to more risk? Yes. Does that mean you shouldnt take that risk? Not really. Otherwise you'd struggle to move quickly and be competitive.
Of course certain things change this balance. Hopefully nuclear power plants dont have NPM in their toolchain. And I believe financial orgs already have quite heavy auditing of dependencies.
Re:NPM package event-source-polyfill compromised by politica...
by exfascist on Friday April 08, 2022 @09:47PM
(#30964558)
Open source and large dependency trees are orthogonal. You can depend on closed modules in compiled languages, many people do. You can write open source software and only depend on the standard library, many people do.
Re:NPM package event-source-polyfill compromised by politica...
by megous on Friday April 08, 2022 @11:26PM
(#30965040)
It's literally possible. You just have to have that as a goal from the start of the project. I just looked at our call center product. Across frontend and backend we have 70 npm dependencies required for build/runtime. Most are small.
It's not that hard to do some superficial review once and do a diff of node_modules when updating npm-shrinkwrap.json for whatever reason.
It's utterly irresponsible to not do so when pulling code from untrusted sources like npm.
Don't pull in dependencies which have many dependencies themselves. There are many projects that pride itself on minimalism and lack of transitive dependencies. Choose those. Etc.