Replies: 1 comment 2 replies
-
some prior art to consider here is https://github.com/lirantal/lockfile-lint by @lirantal. i've been using this in a lot of my projects specifically for this reason. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When our project depends a lot,
package-lock.json
will become very large.This will cause a lot of changes in
package-lock.json
when adding a new dependency.This makes it difficult for us to review
package-lock.json
Let's Imagine:
We currently using
https://registry.npmjs.org
inpackage-lock.json
Now, a new contributor initiate a PR and update
package-lock.json
, and it quietly changed one of its dependent's registry tohttps://unknown.registry.com
. This domain name is a domain name prepared by the hacker. It has altered the dependent'spostinstall
hook. When npm downloads this dependency, it can execute the hook functionpostinstall
.This is a disaster for anyone.So we need a whitelist mechanism to download only trusted registries.
Beta Was this translation helpful? Give feedback.
All reactions