| In every of these threads there's a bunch of snarky comments, either acting like this class of attack is exclusive to npm, or that nothing has been done about it. I don't think that's fair. There's plenty of comments mentioning delay lines, and the other good stuff pnpm (and others) have implemented in response to protect package consumers. That bit that's getting less conversation is the tools on the package maintainer side: - MFA for publishing: https://docs.npmjs.com/requiring-2fa-for-package-publishing-... - trusted publishers, available for about a year: https://docs.npmjs.com/trusted-publishers And as of recently, staged publishing, essentially combining the best of both those features: https://docs.npmjs.com/staged-publishing Now you can:
- Publish from CI, without static credentials - AND require a maintainer to approve it using MFA before it actually goes live to the registry If you want you can still use something like GitHub Actions Environments protection to require multiple approvals, or a time delay, on the CI side. We need to encourage the community to adopt these publishing protections or this will continue to be an issue. |
> - trusted publishers, available for about a year: https://docs.npmjs.com/trusted-publishers
According to [1] "All affected packages were published via GitHub Actions OIDC from the RedHatInsights/javascript-clients repository, indicating the upstream CI/CD pipeline itself was compromised."
So the malicious package would have gotten the happy little green star, with users assured it was "Built and signed with provenance."
[1] https://lwn.net/Articles/1075742/