{"id":1031,"date":"2026-05-23T17:20:57","date_gmt":"2026-05-23T17:20:57","guid":{"rendered":"https:\/\/thedigitalfortress.us\/?p=1031"},"modified":"2026-05-23T17:20:57","modified_gmt":"2026-05-23T17:20:57","slug":"npm-adds-2fa-gated-publishing-and-package-install-controls-against-supply-chain-attacks","status":"publish","type":"post","link":"https:\/\/thedigitalfortress.us\/?p=1031","title":{"rendered":"npm Adds 2FA-Gated Publishing and Package Install Controls Against Supply Chain Attacks"},"content":{"rendered":"<div>\n<p><span class=\"p-author\"><i class=\"icon-font icon-user\">\ue804<\/i><span class=\"author\">Ravie Lakshmanan<\/span><i class=\"icon-font icon-calendar\">\ue802<\/i><span class=\"author\">May 23, 2026<\/span><\/span><span class=\"p-tags\">Software Supply Chain \/ DevSecOps<\/span><\/p>\n<\/div>\n<div id=\"articlebody\">\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi4rnMZgOYbsYr65UN9AZ3oFzcAwqXSYqgRfjUGpeaQeyP-0OAaqJ9aceXPAiujRKwyGQMa_4ShcSvtOWPb9T3qpqF2LATAw2U4iA7IkU9ok0alDbzN_WYJeaZ1SrF0-vyRrEHGedMEcCeP2otYYqplHmqEBda1R_MePbWgEpt-b-GB_RhxJLDC1pJFV0S0\/s1700-e365\/npm-security.png\" style=\"display: block;  text-align: center; clear: left; float: left;\"><\/a><\/div>\n<p>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.<\/p>\n<p>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 a package before it is pushed to the npmjs[.]com.<\/p>\n<p>\u00abInstead of a direct publish that immediately makes a package version available to consumers, the prebuilt tarball is uploaded to a stage queue where a maintainer must explicitly approve it before it becomes installable,\u00bb GitHub <a href=\"https:\/\/github.blog\/changelog\/2026-05-22-staged-publishing-and-new-install-time-controls-for-npm\/\">said<\/a>.<\/p>\n<p>The Microsoft-owned subsidiary said the change ensures \u00abproof of presence\u00bb for every publish, including those that come from non-interactive CI\/CD workflows and trusted publishing with OpenID Connect (OIDC) authentication.<\/p>\n<p>Before using <a href=\"https:\/\/docs.npmjs.com\/staged-publishing\">staged publishing<\/a>, package maintainers have to meet the following criteria &#8211;<\/p>\n<ul>\n<li>Have publish access to the package<\/li>\n<li>Package already exists on the npm registry, meaning a brand new package cannot be staged<\/li>\n<li>2FA is enabled for the account<\/li>\n<\/ul>\n<p>Developers can use the command \u00abnpm stage publish\u00bb from the root directory of the package to submit it to a staging area. To use this command, it&#8217;s essential to update to npm CLI 11.15.0 or newer. For optimal protection, GitHub is recommending that staged publishing be paired with <a href=\"https:\/\/docs.npmjs.com\/trusted-publishers\">trusted publishing<\/a> using OIDC.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/threatlabz-vpn-risk-2026-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhnNON5UeWywT7OcPNw7V4L7QNWnCnm7Xl_99Y9ek8dL-gRwx-bWxQM1TKqt8deqqrdpUyKMuuijAWyyPQVB0s0qf8ntQ6ldFAJLru-QUWhddKTopc7SeNbBBnd-TsfFyRPP-AAyDuclLlL6XHK4_LXqDC_7eyaz9pzToYr7U543MhrJ7qcK-89sVWHTQUZ\/s728-e100\/zz-2-d.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>A second update focused on npm relates to the introduction of three new install source flags alongside the existing -allow-git flag &#8211;<\/p>\n<ul>\n<li>&#8211;allow-file: Controls installs from local file paths and local tarballs<\/li>\n<li>&#8211;allow-remote: Controls installs from remote URLs, including https tarballs<\/li>\n<li>&#8211;allow-directory: Controls installs from local directories<\/li>\n<\/ul>\n<p>The flags allow developers to \u00abapply the same explicit-allowlist approach to every non-registry install source,\u00bb GitHub said.<\/p>\n<p>The development comes amid a massive surge in software supply chain attacks targeting open-source ecosystems over the past few months, with one cybercriminal group known as TeamPCP engaging in poisoning popular packages at an unprecedented scale through a self-perpetuating cycle of compromises.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ue804Ravie Lakshmanan\ue802May 23, 2026Software Supply Chain \/ DevSecOps GitHub has rolled out new controls for npm to improve the security of the software supply chain, giving maintainers the ability to&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1032,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1777,200,24,219,1780,1779,39,40,1778,218],"class_list":["post-1031","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-2fagated","tag-adds","tag-attacks","tag-chain","tag-controls","tag-install","tag-npm","tag-package","tag-publishing","tag-supply"],"_links":{"self":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1031"}],"version-history":[{"count":0,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/1031\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/media\/1032"}],"wp:attachment":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}