▲ | simiones 4 hours ago | |
The point is still different. In PyPI, if I put `requests` in my requirements.txt, and I run `pip install -r requirements.txt` every time I do `make build`, I will still only get one version of requests - the latest available the first time I installed it. This severely reduces the attack radius compared to NPM's default, where I would get the latest (patch) version of my dependency every day. And the ecosystem being committed to respecting semver is entirely irrelevant to supply chain security. Malicious actors don't care about semver. Overall, publishing a new malicious version of a package is a much lesser problem in virtually any ecosystem other than NPM; in NPM, it's almost an automatic remote code execution vulnerability for every NPM dev, and a persistent threat for many NPM packages even without this. | ||
▲ | lucideer 25 minutes ago | parent | next [-] | |
> every time I do `make build` I'm going to assume this is you running this locally to generate releases, presumably for personal projects? If you're building your projects in CI you're not pulling in the same version without a lockfile in place. | ||
▲ | debazel 3 hours ago | parent | prev [-] | |
> This severely reduces the attack radius compared to NPM's default, where I would get the latest (patch) version of my dependency every day. By default npm will create a lock file and give you the exact same version every time unless you manually initiate an upgrade. Additionally you could even remove the package-lock.json and do a new npm install and it still wouldn't upgrade the package if it already exists in your node_modules directory. Only time this would be true is if you manually bump the version to something that is incompatible, or remove both the package-lock.json and your node_modules folder. |