▲ | dwoldrich 5 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I am an npm user. My reaction to these software supply chain attacks is to stop taking updates unless absolutely necessary for vulnerability mitigation or to selectively take performance or feature upgrades on a package-by-package basis. Obviously, that approach still opens me up to attacks based on when I choose to take updates that coincides with a malicious package release, but I feel like an extreme reluctance to upgrade will mostly keep me safe. To achieve my goal, would this approach work: - Pin all of my package.json versions (no prefacing versions with ~ or ^) - Routine installation of packages both on my local and on CI servers will be done using `npm ci` - `npm install <package_name> --save-exact/--save-dev` would be used only at the time of adding a package to package.json, followed by an `npm ci` - Rely on tooling like GitHub Dependabot and CodeQL to inform the team when a dependency should be updated for security reasons and then manually update only the dependency with the desired version using `npm install lodash@4.17.21 --save-exact`, for example EDIT: Thinking about this more, we would have to forbid deleting the package-lock.json and regenerating it with `npm install` and forbid the use of `npm update` so that package-lock.json would stay stable. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | sedatk 5 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's all good until the day comes that one dependency breaks compatibility and drops support for the version you have, and now you have days of dependency resolution work ahead of you because you've never bothered for years. Usually, incremental and timely upgrades reduce that kind of friction. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|