Show HN: Auto install npm dependencies as you code
1–10 of 80 posts
Re: Show HN: Auto install npm dependencies as you code
#2Re: Show HN: Auto install npm dependencies as you code
#3Re: Show HN: Auto install npm dependencies as you code
#4Re: Show HN: Auto install npm dependencies as you code
#5Maven knows I've made the mistake of triggering a big download on a bad network.
Re: Show HN: Auto install npm dependencies as you code
#6Re: Show HN: Auto install npm dependencies as you code
#7I've successfully used Detective in a couple of my personal projects to find all require statements.
Relevant issue on Detective: https://github.com/substack/node-detective/issues/8
Re: Show HN: Auto install npm dependencies as you code
#8So I can make a malicious module called expres and another one called expresss and screw with ppls machines?
Installing modules from npm is dangerous enough. Nice for education or playing around, unsuitable for a serious developers' workstation.
Related: http://incolumitas.com/2016/06/08/typosquatting-package-mana...
Re: Show HN: Auto install npm dependencies as you code
#9Re: Show HN: Auto install npm dependencies as you code
#10So I can make a malicious module called expres and another one called expresss and screw with ppls machines?
I love that the Node community enjoys innovating for convenience, but ideas like this one are less than half-baked from a security perspective. Just make a few typo'd popular packages, and use npm install scripts [1] and you have a very easy remote code execution vector on developer workstations.
The bigger problem I see is that npm is a circus. No package signing and a ridiculous debate on why that's been going on for a year and a half [2]. Credentials leaks of popular modules. [3]
When everything is a module and everyone is supposed to include modules vs. writing their own very simple functionality for things even like isArray polyfills [4] (24MM downloads a month!), you end up with the same attack surface that gives WordPress such a shitty reputation for security. It's not usually core, it's all the plugins by authors of unknown provenance and skill. WordPress gets pwned because there are a lot of plugins hastily written by new developers and used without audit by mom-and-pop web app shops and/or those that trust the code because they aren't capable of auditing it meaningfully.
When you use an npm dependency, you are taking on all of their dependencies. You are trusting they don't leak creds, that npm has not been compromised, and that the chain underneath has been audited for malicious behavior. In reality this is impractical: go npm install express and see just how deep the dependency chain goes. Things like Snyk are required to just understand what might be vulnerable.
[1] https://docs.npmjs.com/misc/scripts
[2] https://github.com/node-forward/discussions/issues/29
[3] https://github.com/ChALkeR/notes/blob/master/Do-not-underest...
[4] https://www.npmjs.com/package/isarray
EDIT: Ironically, this module itself is vulnerable to code injection.