News for hackers. Stuff that matters.
Re:Devs unknowingly use “malicious” modules snuck into offic... by onion2k on Monday September 18, 2017 @03:13AM (#15273915)
Debian has ~3000 packages, and every single package had an identified maintainer...

As of yesterday npmjs had 516,132 packages, which was an increase of 373 since the day before. Debian's 3000 packages is a couple of weeks of npmjs activity. Even if you stripped out the unnecessary, abandoned, or duplicate packages you're still looking at a something significantly different to Debian.

For what it's worth I think a well-maintained, verified, and known secure subset of npmjs would be a great idea, but the logistics of providing that would be effectively impossible without some serious cash behind it.

Re:Devs unknowingly use “malicious” modules snuck into offic... by seanp2k2 on Monday September 18, 2017 @04:14AM (#15274159)
The culture around what should be in a package is vastly different. Node has left-pad. Debian has stuff like Apache. Sure, those are radical examples, but the barrier to entry for Debian is pretty high (as is the standard for quality) vs npm where anyone can put whatever out there.

How do things like left-pad even come to be widespread dependencies? Does the node development process involve a lot of "gee I wonder if someone made a package for (simple thing I need to do with a few lines of code)"?

Re:Devs unknowingly use “malicious” modules snuck into offic... by ubernostrum on Monday September 18, 2017 @06:19AM (#15274624)
JavaScript has things like left-pad because it doesn't have a standard library of modules for common tasks like other languages do, and because some of its built-in types don't have the same rich set of operations as other languages.
Re:Devs unknowingly use “malicious” modules snuck into offic... by Babooster on Monday September 18, 2017 @09:10AM (#15275499)
http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how...

is a nice article on the subject of left-pad. If you can't implement a left-pad in less than 5 minutes yourself, you don't know how to code.

Re:Devs unknowingly use “malicious” modules snuck into offic... by Ajedi32 on Monday September 18, 2017 @09:34AM (#15275750)
Just because you _can_ spend 5 minutes re-inventing the wheel in every project you write, doesn't mean you _should_.
Re:Devs unknowingly use “malicious” modules snuck into offic... by chii on Monday September 18, 2017 @06:35AM (#15274686)
But the large number of packages available, even for seemingly trivial features, are what makes NPM popular and successful. You jest at left-pad, but there's real value in simple libraries they might only be "a few lines of code" because an app is made up of a large amount of "simple features" strung together.

Not to mention the code reuse factor.

If npm took the route of debian's verification/certification, you might end up with no libs at all!

Re:Devs unknowingly use “malicious” modules snuck into offic... by dozzie on Monday September 18, 2017 @03:21PM (#15278704)
> You jest at left-pad, but there's real value in simple libraries they might only be "a few lines of code"

Nicely said, but you omit the elephant in the room: that the dependencies have their cost, which is quite high and is rarely matched, much less offset, by the value of these "simple libraries".

Re:Devs unknowingly use “malicious” modules snuck into offic... by mafro on Monday September 18, 2017 @03:39AM (#15274028)
FWIW I have always thought this would become a problem for nodejs. Encouraging one-liner packages [1][2] is a recipe for an enormous dependency tree, and a totally impossible-to-manage security situation.

Python projects I have recently worked on might max out at 50 packages. The last project I worked on with nodejs as front end had 3000+ packages just for the UI.

[1] https://github.com/sindresorhus/ama/issues/10#issuecomment-1... [2] https://github.com/kevva/is-positive

Re:Devs unknowingly use “malicious” modules snuck into offic... by coldtea on Monday September 18, 2017 @04:44AM (#15274289)
>As of yesterday npmjs had 516,132 packages, which was an increase of 373 since the day before. Debian's 3000 packages is a couple of weeks of npmjs activity.

Only in volume. In code quality and man hours they're an order of magnitude ahead of all of npm.

(Just consider something like Linux the kernel, GCC, Apache, OpenJDK, core utils, Python, Postgres, etc, compared to the trite that even the best npm packages are).

Re:Devs unknowingly use “malicious” modules snuck into offic... by gjjrfcbugxbhf on Monday September 18, 2017 @03:51AM (#15274070)
Debian packages on average have more functionality than npm packages. Such a subset as you describe would be one (or a few) Debian package(s).