npm’s new security controls are a welcome step toward reducing the blast radius of open-source supply-chain attacks. GitHub has introduced staged publishing for npm, where a package tarball is first uploaded to a staging queue and must be explicitly approved by a human maintainer using 2FA before it becomes publicly installable. This adds an important “proof of presence” step, especially for releases coming from CI/CD workflows and trusted publishing through OIDC.
This matters because attackers increasingly target the publishing pipeline itself. If a maintainer token, CI workflow, or automation process is compromised, malicious packages can be pushed at scale before anyone notices. Requiring human 2FA approval before a package goes live creates friction at exactly the right point. Annoying? Yes. Useful? Also yes. Security is often the art of making attackers slightly more miserable than developers.
The new npm install source controls are also important. GitHub has added flags such as --allow-file, --allow-remote, and --allow-directory, extending explicit allowlisting to installs from local paths, tarballs, remote URLs, and local directories. This helps teams reduce risk from non-registry installs, which attackers often abuse because build systems tend to trust whatever weird dependency path someone added months ago and then spiritually abandoned.
Organizations using npm should encourage maintainers to enable 2FA, adopt staged publishing, use trusted publishing with OIDC, restrict package publishing rights, and review CI/CD release workflows. Development teams should also control non-registry install sources, monitor unexpected dependency changes, pin critical packages where appropriate, and ensure secrets are not exposed inside build environments.
The broader lesson is simple: software supply-chain security must protect the path from developer to registry to production. Package names, maintainer accounts, release automation, install sources, and CI/CD identities all need governance. A secure package ecosystem cannot rely only on trust and good intentions, because attackers have repeatedly demonstrated they are very interested in both and respectful of neither.

GitHub has rolled out new controls for npm to improve the security of the software supply chain, giving maintainers the ability to explicitly approve a release prior to the packages becoming publicly available for installation. Called staged publishing, the feature is now generally available on npm. It mandates that a human maintainer pass a two-factor authentication (2FA) challenge to approve
Source: npm Adds 2FA-Gated Publishing and Package Install Controls Against Supply Chain Attacks via The Hacker News — published 23 May 2026.
Was this article helpful?
Your feedback helps us improve the knowledge base.