GitHub Adds Staged Publishing to Strengthen npm Security.

GitHub has rolled out two critical supply-chain security upgrades for the npm ecosystem: staged publishing, now generally available, and new install-time source restriction flags, both of which land in npm CLI 11.15.0, released on May 22, 2026.

Staged publishing fundamentally restructures how package versions are published to the npm registry.

Instead of a direct publish that instantly exposes a new version to all consumers, the prebuilt tarball is now routed to a staging queue where a human maintainer must complete a 2FA challenge before the package becomes publicly installable.

GitHub Strengthen npm Security 

The staged queue is visible on both npmjs.com and the npm CLI, giving maintainers full transparency before any version goes live.

GitHub describes this as enforcing “proof of presence” on every publish, including those originating from non-interactive CI/CD pipelines and trusted publishing workflows using OpenID Connect (OIDC).

This effectively closes the gap where automated publishing could push malicious code downstream without any human review. Before using staged publishing, maintainers must meet the following requirements:

  • Publish access to the package must be confirmed
  • The package must already exist on the npm registry (new packages cannot be staged)
  • 2FA must be enabled on the maintainer’s account
  • npm CLI 11.15.0 or newer must be in use

GitHub recommends pairing staged publishing with trusted publishing (OIDC), where a CI/CD configuration is locked to npm stage publish only directly rejecting any npm publish calls.

CI workflows continue running non-interactively, while a maintainer approves from a trusted device post-pipeline.

Building on the --allow-git flag introduced in npm 11.10.0, npm 11.15.0 adds three new flags that extend the explicit-allowlist model to all non-registry install sources:

  • --allow-file — Controls installs from local file paths and local tarballs
  • --allow-remote — Controls installs from remote URLs, including HTTPS tarballs
  • --allow-directory — Controls installs from local directories
  • --allow-git (existing) — Controls installs from Git sources, including github:gitlab:, and git+ URLs

Each flag accepts all (current default) or none, and can be configured in .npmrc or package.json. Security teams can opt into stricter behavior immediately by setting any of these flags to none.

Notably, --allow-git it is slated to change its default from all to none in the upcoming npm CLI v12 signaling a broader industry shift toward deny-by-default dependency sourcing.

These updates arrive against a backdrop of accelerating supply-chain attacks across the JavaScript ecosystem.

In 2025, the multi-wave Shai-Hulud campaign exploited compromised npm maintainer credentials via phishing to inject a self-replicating worm into widely used packages, steal cloud tokens, scan repositories with TruffleHog, and exfiltrate secrets at scale.

More recently, a TeamPCP threat group was identified for poisoning popular packages at an unprecedented scale through a self-perpetuating compromise cycle.

The Socket Research Team also reported the TrapDoor crypto-stealer campaign targeting 34 packages across npm, PyPI, and Crates.io as recently as May 24, 2026.

Security researchers, have argued that credential hardening alone is insufficient, calling for registry-side anomaly detection, such as flagging publishes from unusual geolocations and restricting lifecycle script changes to major version bumps.

Staged publishing directly addresses that concern by introducing a registry-level pause, slowing the propagation of a compromised release even when valid credentials are used.

Mitigation

Organizations managing npm packages should take the following actions immediately:

  • Upgrade to npm CLI 11.15.0 or newer
  • Switch CI/CD workflows from npm publish to npm stage publish
  • Enable OIDC-based trusted publishing and lock configurations to stage-only
  • Set --allow-file--allow-remote--allow-directory, and --allow-git to none in .npmrc for hardened environments
  • Use WebAuthn over TOTP for 2FA on accounts with write access

Follow us on Google News , LinkedIn and X to Get More Instant UpdatesSet Cyberpress as a Preferred Source in Google.

Tamilselvan
Tamilselvanhttps://cyberpress.org/
Tamilselvan is an Investigative cybersecurity journalist dedicated to breaking stories on ransomware cartels, data breaches, and state-sponsored espionage.

Trending News

Related Stories