Skip to content

The publication for web craftspeople Tuesday, 1 December 2026

Security

npm locks batch publishing behind a single 2FA approval

npm shipped batch approval for staged publishing on November 30, 2026: a handful of packages from the same monorepo can now be validated with a single 2FA step, built as a response to 2026's waves of supply chain attacks.

The npm team shipped an update to its “Staged Publishing Plans” on November 30, 2026: staged releases from a monorepo can now be grouped into a single batch, approved with one two-factor authentication step instead of one approval per package. The announcement lands in a charged context: 2026 saw several waves of attacks on the npm supply chain, from the AsyncAPI package compromise in July to the “Mini Shai-Hulud” campaign hitting over 320 packages.

The problem with multi-package releases

Before this change, every version of every package in a monorepo triggered its own 2FA challenge at publish time. For a library split into ten interdependent packages, that meant ten manual approvals, executed in an order that wasn’t guaranteed. A package could end up published before one of its own internal dependents, breaking installs mid-release.

How batch approval works

The mechanism stays simple: a batch holds at most one staged version per package, and the whole batch is published at once after a single 2FA approval. That approval is tied precisely to the set of packages and versions shown at approval time; any change to the batch afterward invalidates the original approval. npm also frames this staged publishing as a possible eventual mandatory fallback for maintainers who currently hold access tokens that bypass 2FA.

BeforeWith batch approval
One 2FA approval per published packageA single 2FA approval for the whole batch
Publish order not guaranteedBatch fixed at approval time
Inconsistency window between linked packagesBatched publish, atomic from the approval’s point of view
npm publish --tag stage --dry-run
npm access grant staged-publish --otp 123456
npm publish --from-staged

The approval is tied to the exact set of packages and versions shown at the moment it’s given, not to a generic batch.

Batch approval cuts operational friction, but it doesn’t replace basic vigilance: maintainer verification, package provenance, and monitoring of transitive dependencies all still matter. The 2026 npm attacks mostly exploited maintainer accounts compromised upstream of publishing, a point batched 2FA doesn’t cover by itself.

Key takeaways

This change targets monorepo maintainers directly, who until now published their linked packages one by one at the cost of repeated 2FA. It fits a broader trend of hardening publishing chains across open-source ecosystems, after a year marked by repeated compromises of widely used packages.

On paper, grouping 2FA approvals looks like a minor convenience. In practice, it’s mostly an admission: per-package 2FA was painful enough that some maintainers were tempted to work around it with tokens that skip 2FA entirely — exactly the gap 2026’s attackers exploited. Reducing friction on the right path is usually more effective than piling up warnings about the wrong one. — Simon Janvier

To go further: GitHub changelog on npm batch publish approval.

Read next