npm Trusted Publishing Flaw Exposed 1,500+ Packages to Hijacking
A vulnerability in npm's trusted publishing feature allowed attackers to exploit unvalidated publishing configurations, enabling unauthorized package versions to be published without stealing credentials. The flaw highlights how misconfigured or unvalidated CI/CD pipeline integrations can become an attack vector in the software supply chain. Because npm packages are consumed by millions of developers globally, even a single hijacked package can cascade into widespread downstream compromise. GitHub's 48-hour expiration window for unvalidated configurations is a meaningful mitigation, but organizations must also audit their own dependency chains for affected packages.
Tactical Insight
Immediate actions
- Audit all npm packages your organization publishes or depends on to verify they were not affected by unvalidated trusted publishing configurations.
- Enable GitHub/npm security alerts and review any trusted publishing configurations currently in a pending/unvalidated state.
Long-term improvements
- Enforce a policy requiring trusted publishing configurations to be validated and approved before any pipeline can use them in production.
- Implement software composition analysis (SCA) tools to continuously monitor third-party dependencies for integrity and supply chain risks.
- Adopt a package pinning and lock-file strategy to prevent automatic adoption of maliciously injected package versions.
Detection measures
- Monitor npm publish events and registry activity logs for unexpected or unauthorized package version releases.
- Set up alerts for any changes to CI/CD pipeline publishing credentials or trusted publishing configurations across your organization's repositories.