logoalt Hacker News

dtechyesterday at 5:56 AM2 repliesview on HN

Npm has weak security boundaries.

Basically any dependency can (used to?) run any script with the develop permissions on install. JVM and python package managers don't do this.

Of course in all ecosystems once you actually run the code it can do whatever with the permissions of the executes program, but this is another hurdle.


Replies

lights0123yesterday at 6:21 AM

Python absolutely can run scripts in installation. Before pyproject.toml, arbitrary scripts were the only way to install a package. It's the reason PyPi.org doesn't show a dependency graph, as dependencies are declared in the Turing-complete setup.py.

show 1 reply
silverwindyesterday at 2:28 PM

Deno has tackled some of these issues with their permission system, but afaik it can only be applied to apps, not to dependencies.

What we really need is a system to restrict packages in what they can do (for example, many packages don't need network access).

show 1 reply