Citation needed. /sDespite the impression you might get from my posting sometimes, I don't really genuinely hate many people.
You mean “every eager developer beaver who has mastered cut-and-paste from Stack and believes that now unlocks car, house, influence” and knows how to play on weak management or clients that they’re uncool if they don’t get the “business value” they “provide.”A supply chain attack is only as useful as the idiot that accepts everything.
While I agree with the sentiment, I have to ask- have you looked at how many packages a typical JS application using NPM likely has installed? This is like saying all dependencies should be audited. That makes sense and sounds perfectly reasonable, until you factor in transient dependencies in these kinds of projects and it quickly becomes unreasonable in the sense that you will be forever delayed in even pushing out critical updates for first party dependencies you actually reference directly in your application. I would argue it's even impossible to maintain a project using NPM over a long period of time without some kind automation to keep up with these issues for you, which plenty of developers just won't have easy access to. The node ecosystem (at least, perhaps others) is simply a huge mess in this regard.Typo-squatting? UTF-8 invisible characters? Cyrillic anything?
It's time package maintainers explicitly allowed imports and that which they don't allow doesn't get imported. Period. A supply chain attack is only as useful as the idiot that accepts everything.
always always always use your own vetted repo, or at least pull from a managed local repo, so that you don't get every version under the sun within your builds.This is one reason why I'm wary of automated build systems that pull in 500 packages from a remote repository that I don't control.
Give me locally hosted libraries and (shakes cane, yells at cloud) get off my lawn!
That also saves you from Left-Pad incidents - https://en.wikipedia.org/wiki/Npm_left-pad_incidentalways always always use your own vetted repo, or at least pull from a managed local repo, so that you don't get every version under the sun within your builds.
Locally hosted, version pinned dependencies FTW.This is one reason why I'm wary of automated build systems that pull in 500 packages from a remote repository that I don't control.
Give me locally hosted libraries and (shakes cane, yells at cloud) get off my lawn!
Considering that the attack vector involves bypassing the repos entirely, I don't see that being a salient point here. How do you handle people misspelling your name and getting your opinions from -prete-?So I guess these repos need active vetting processes. Which won't be free to setup.
This can go too far, though. I did some work for a large company that had a strict policy that all packages and updates needed to go through a manual cyber-security and legal review before they could be added to the local repository. When dealing with packages and their dependencies (and dependencies of dependencies) this became a real headache.Locally hosted, version pinned dependencies FTW.
If a package included in the dependencies has a security update, you do "go through a manual cyber-security and legal review" required for it to meet the new, fixed position and then research all the changes needed for things depending on it needed to support the change. That's the baseline, not the end goal.
I have no idea what the rest of your message was supposed to be about given that. Are you running your codebase from github?
These are not the the developer tools you think they are.
Thats why any serious company should use repository proxy that has that functionality and setup sources of packages that ideally verify identity or require package authors to use mfa or other precautions. If something hits the fan it also gives you option to see where was the impact, since you store a docker images inside too.There are plenty of tools out there to protect against installing malicious packages (we use an amphibian-themed product), but it really seems like package managers could assist here by offering some basic functionality out-of-the-box.
If two packages are similarly-named, yet one has hundreds of thousands of installs over several years, and the other is brand-new, then a simple warning when installing is surely feasible. The logic for this probably wouldn't be onerous. Many package managers already offer suggestions for similarly-named packages when they don't find a match, and this could surely be leveraged to find possible typo-squatted package names.
I can only concur. For years we relied on a build system where nothing had to be downloaded from the intarweb during build, allowing us to set up a set of nodes deep within our infrastructure that was able to build 100+ different projects for multiple OS arch.While I agree with the sentiment, I have to ask- have you looked at how many packages a typical JS application using NPM likely has installed? This is like saying all dependencies should be audited. That makes sense and sounds perfectly reasonable, until you factor in transient dependencies in these kinds of projects and it quickly becomes unreasonable in the sense that you will be forever delayed in even pushing out critical updates for first party dependencies you actually reference directly in your application. I would argue it's even impossible to maintain a project using NPM over a long period of time without some kind automation to keep up with these issues for you, which plenty of developers just won't have easy access to. The node ecosystem (at least, perhaps others) is simply a huge mess in this regard.
All dependencies should be audited. That the JS ecosystem has grown into a thing that makes this impossible is pretty damning. Including transient dependencies, the last major project I worked on had C++ with about 10 dependencies (manageable); python with about 100 dependencies (yuk); and JS/TS with multiple thousands (insane).While I agree with the sentiment, I have to ask- have you looked at how many packages a typical JS application using NPM likely has installed? This is like saying all dependencies should be audited. That makes sense and sounds perfectly reasonable, until you factor in transient dependencies in these kinds of projects and it quickly becomes unreasonable in the sense that you will be forever delayed in even pushing out critical updates for first party dependencies you actually reference directly in your application. I would argue it's even impossible to maintain a project using NPM over a long period of time without some kind automation to keep up with these issues for you, which plenty of developers just won't have easy access to. The node ecosystem (at least, perhaps others) is simply a huge mess in this regard.
I am wondering what the actual amount of code in those dependencies is.All dependencies should be audited. That the JS ecosystem has grown into a thing that makes this impossible is pretty damning. Including transient dependencies, the last major project I worked on had C++ with about 10 dependencies (manageable); python with about 100 dependencies (yuk); and JS/TS with multiple thousands (insane).
Package dependencies are for sissies.
The problems with "batteries" included is one, you can never include everything - people are always coming up with new things - new batteries if you will. Two, you then add significant bloat to programs for all the 'batteries' they don't use.I'm a big fan of "batteries included". I think it's partly because I grew up with computers in the 1980s - the golden era of machines that had limited facilities, yet provided support for all of them in its standard library. (Even if that standard library was actually just extensions built into its BASIC interpreter.)
When I moved to an IBM PC and tried languages like C, I kind of fell out of love with programming a little. Suddenly doing everything you wanted to required so much more effort.
After a while there was then a move towards batteries included with languages/platforms like Python, Java and .NET. Each had a large, well maintained standard library. Suddenly programming felt a bit more like it did when I was a kid - 90% of what I wanted to do was already covered without me needing to jump through extra hoops.
Now to be clear I'm not saying that the late 80s and early 90s were somehow filled with inadequate languages. It's more that hardware and operating environments were dramatically outpacing what programming languages were giving us, unless you were willing to spend significant coin.
All this is to say that I do think a decent standard library is a virtue. And one that we should cherish and strive for.
I've never considered using node.js, but the left-pad incident was a major warning sign to me. The idea that basic features were being left out for others to fill the gaps just doesn't feel right, and these kinds of supply chain attacks are a big part of that unease.
The less we have to add in later and check, the better. And the checks we do can be better, as we're not overwhelmed by additional packages. But worse, if even the simple stuff requires additional packages, then people become blasé about them and that increases their likelihood of being successfully attacked.
Batteries included. You know it makes sense.
Oh good, so it's a victimless crime.The malicious packages have names that are similar to legitimate ones for the Puppeteer and Bignum.js code libraries and for various libraries for working with cryptocurrency.
There is a lot more security control and institutional knowledge. It helps that for maven you can control the ownership by package prefixes - nobody can just release package in prefix like org.apache and large package repositories like sonatype mandated things like MFA for developers and TLS for users long time ago. There are good design decisions like when you release a a package with version you cannot change it afterwards. There were some attacks but I believe the overal architekture is more robust.Has the Apache Maven repos ever suffered a supply chain attack like this? Seems to me that maven automatic dependency downloading is pretty similar in concept to NPM, and yet, I don't think I've ever heard of an attack like this? Entirely possible I just missed it
Micro-libraries are all the rage with frontend devs these days.I am wondering what the actual amount of code in those dependencies is.
A lot of npm packages are really small.