> The post install script can be like any other script the user can run. There's no sandboxing so it can access anything the running user can access.
Wow. This just seems wrong that the script has such far reaching privileges.
Once the package is installed, it is already too late for a code review, or any mitigation. A well-written worm will never be detected.
It is unexpectedly bad design (or, in case of the JavaScript community, an expectedly bad design).
https://www.npmjs.com/package/uglifyjs
It's getting 30k+ downloads a month.
The actual package people are looking for is here: https://www.npmjs.com/package/uglify-js
If you run `npm install` on a project, you're simply installing its dependencies (and actually running any pre-publish hooks too, for some stupid reason).
Enjoy life!
If this were possible, something like this could have the potential to infect quite a few npm modules.