1 min readfrom InfoQ

npm Staged Publishing Available, Adding a Human Approval Step Before Packages Go Live

Our take

npm has introduced staged publishing, a significant advancement in Node.js package security. Now, versions are queued and require maintainer approval—including a two-factor authentication challenge—before becoming installable. This critical step directly addresses rising supply chain risks and provides an essential layer of protection. Available in npm CLI 11.15.0+ and Node 22.14.0+, staged publishing is accompanied by new, configurable permission flags. As demonstrated by recent events, like the keyv incident discussed in "The Shai-Hulud npm worm," proactive security measures are paramount.
npm Staged Publishing Available, Adding a Human Approval Step Before Packages Go Live

The introduction of staged publishing in npm is a significant, albeit long-overdue, step toward bolstering the security of the Node.js ecosystem. The recent surge in supply chain attacks, vividly illustrated by incidents like the The Shai-Hulud npm worm didn't fake its security check — it earned a legitimate one, highlights the critical vulnerabilities inherent in a system where package publishing is often a largely automated process. Requiring maintainer approval, coupled with a two-factor authentication challenge, adds a crucial layer of human oversight that can prevent malicious code from being inadvertently distributed. While not a panacea – as demonstrated by the complexities revealed in articles like PSA: Apple’s Private Relay can leak your real IP address – it represents a tangible move towards a more secure development environment, acknowledging that automated systems, however sophisticated, are not infallible.

The implications of this change extend beyond simply preventing immediate attacks. It also fosters a culture of greater responsibility among package maintainers. The act of consciously approving a release, rather than simply pushing code to the registry, encourages a more deliberate and thoughtful approach to development and security practices. This is particularly important given the interconnected nature of Node.js projects; a single compromised package can have cascading effects across numerous applications. Furthermore, the new configurable permission flags offered alongside staged publishing provide more granular control over who can publish and manage packages, further reducing the risk of unauthorized modifications. The ongoing concern over vulnerabilities in seemingly secure systems, as exemplified by the recent exploits targeting hardware wallets, Hackers steal over $130M by exploiting bug in offline hardware wallets, underscores the need for multi-layered security approaches, and npm’s staged publishing represents a valuable addition to that defense.

However, it’s important to acknowledge potential challenges. The introduction of a manual approval step inevitably adds friction to the publishing workflow. This could be perceived as a barrier by some maintainers, particularly those managing numerous packages or working under tight deadlines. The success of this feature will depend on how seamlessly it integrates into existing development processes and whether the security benefits outweigh the added complexity. npm will need to provide clear guidance and tooling to ensure that staged publishing is adopted effectively and doesn't become a bottleneck. Moreover, this isn’t a replacement for robust code review practices and vulnerability scanning; it’s a complementary measure that adds an extra safeguard against accidental or malicious releases.

Looking ahead, it’s likely that we’ll see further evolution in package management security, with increased emphasis on automated vulnerability detection, dependency analysis, and proactive threat intelligence. While staged publishing addresses a critical vulnerability, the Node.js ecosystem remains a complex and evolving target. The question now is whether this change will spark a broader industry conversation around accountability and security best practices in open-source package management, prompting other registries and package managers to adopt similar measures and fostering a more secure and trustworthy development landscape for all.

npm has introduced staged publishing for Node.js, requiring maintainer approval before a version is installable. Versions are queued and must pass a two-factor authentication challenge for release. This feature aims to enhance security amid rising supply chain threats. It is available in npm CLI 11.15.0+ and Node 22.14.0+, alongside new configurable permission flags.

By Daniel Curtis

Read on the original site

Open the publisher's page for the full experience

View original article