Skip to main content
r/javascript icon

r/javascript

members
online


Getting the all-new iPhone 17 Pro for $0 without needing the most expensive plan? Good call.
media poster



[AskJS] what makes NPM less secure than other package providers? [AskJS] what makes NPM less secure than other package providers?
AskJS

After shai halud, I find myself wondering what it is that makes NPM less secure than, say, maven? Based on what I know, stealing publishing credentials could be done to either service using the approach Shai halud did.

The only thing I can think of is as follows:

  1. The NPM convention of using version ranges means that publishing a malicious patch to a dependency can more easily be pulled in during the resolution process, even if you're not explicitly adding that dependency.

  2. The NPM postinstall mechanism, which was a big part of the attack vector, is a pretty nasty thing.

Anything else that makes NPM more vulnerable than maven and others?