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
Uh oh!
There was an error while loading. Please reload this page.
-
When our project depends a lot,
package-lock.jsonwill become very large.This will cause a lot of changes in
package-lock.jsonwhen adding a new dependency.This makes it difficult for us to review
package-lock.jsonLet's Imagine:
We currently using
https://registry.npmjs.orginpackage-lock.jsonNow, 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'spostinstallhook. 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