7 ms·
Longtime node.js developer... I don't think we need this, and I don't think it's a good idea to add. The feature is _strange._ Which we know because it's behin
by mitchellst 5y ago
Longtime node.js developer... I don't think we need this, and I don't think it's a good idea to add.
The feature is _strange._ Which we know because it's behind a flag, i.e., it will have low utilization. It defies conventions—because the convention is to use a registry for packages. And it presents significant security concerns. (Which I don't really have to explain, as they're already cited as the reason to put it behind a flag.)
Use of this feature seems like something you might see once in a career. (Indeed, I've seen a similar thing in another language employed only once... AND THERE WERE OTHER WAYS for that developer to have designed that system that would not have been so vulnerable.) When you see it, do you recognize what it is, understand and evaluate the risks it poses? Do you validate that the library sitting on the other side hasn't been taken over by a malicious actor? Do you validate that the library on the other side has up-to-date dependencies? If so, on what cadence do you do this, realistically?
All the security tooling progress we've made (npm audit, etc.) seems shot in the foot by this. And I get that these concerns aren't dispositive on their own. I just don't see the argument on the other side that clearly. Is there some class of application that people really want to write in node that can't be written for lacking this? Do we really think this is a pattern that would be employed in well-made, secure codebases? I don't see the argument. Like I said, I've seen a feature like this used in another language. But I haven't seen it needed for any real application.
I love me some good node ugly hacks. Still, the language features should be nudging us to write good software.
- encryptluks2 5y agoCentral authority != Good software. You are essentially advocating to provide a single point of failure that can and will be abused by nation-state hackers who just have to find one popular package and compromise the developer.
- mitchellst 5y agoThe argument is less about central authority than standard process. You don't have to use the official NPM registry. The point is that having a pipeline for modules with established conventions and automated means of audits and visibility on the dependency is a net good. Yes, there is such a thing as a supply chain attack. But even when that happens, the community puts out the call to patch immediately and points a finger at the offending package. Your HTTPS import from a random URL could fail silently. While NPM is a big target for supply chain attack, they know they are, so there are a lot of eyes on it. Not so with your HTTPS import.
- oauea 5y ago> because the convention is to use a registry for packages You can already pull your dependencies from arbitrary URLs, they just have to be tarred up first and go through npm: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#urls-as-dependencies https://docs.npmjs.com/cli/v8/configuring-npm/package-json#u...