{"id":15727,"date":"2026-06-14T15:52:36","date_gmt":"2026-06-14T15:52:36","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=15727"},"modified":"2026-06-14T15:52:36","modified_gmt":"2026-06-14T15:52:36","slug":"npm-12-will-change-script-execution-conduct-to-stop-provide-chain-assaults","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=15727","title":{"rendered":"NPM 12 Will Change Script Execution Conduct to Stop Provide Chain Assaults"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p class=\"wp-block-paragraph\"><strong>In response to a current wave of provide chain assaults focusing on the NPM ecosystem, GitHub introduced that scripts from dependencies will now not be executed by default.<\/strong><\/p>\n<p class=\"wp-block-paragraph\">A number of main incidents that occurred over the previous a number of months, primarily related to <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/topics\/TeamPCP\/\">TeamPCP<\/a> and the <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/topics\/Shai-Hulud\/\">Shai-Hulud<\/a> self-replicating worm, have been abusing the default, automated execution of scripts from dependencies throughout <em>npm set up<\/em> to contaminate hundreds of builders with malware.<\/p>\n<p class=\"wp-block-paragraph\">To raised defend customers, beginning with NPM model 12, which is predicted to reach in July, script execution shall be blocked by default, GitHub introduced.<\/p>\n<p class=\"wp-block-paragraph\">\u201c<em>npm set up<\/em> will now not execute <em>preinstall<\/em>, <em>set up<\/em>, or <em>postinstall<\/em> scripts from dependencies except they&#8217;re explicitly allowed in your venture,\u201d the code-sharing platform <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/github.blog\/changelog\/2026-06-09-upcoming-breaking-changes-for-npm-v12\/\">explains<\/a>.<\/p>\n<p class=\"wp-block-paragraph\">The change will even impression native <em>node-gyp<\/em> builds, equivalent to packages which have a <em>binding.gyp<\/em> and no express set up script, in addition to <em>put together<\/em> scripts from git, file, and hyperlink dependencies. The current<a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/over-100-npm-pypi-packages-hit-in-new-shai-hulud-supply-chain-attacks\/\"> Shai-Hulud Miasma assaults<\/a> relied on a weaponized binding.gyp file.<\/p>\n<p class=\"wp-block-paragraph\">To test how the upcoming change will impression their initiatives, builders can run <em>npm approve-scripts \u2013allow-scripts-pending<\/em>, and permit the packages they belief and block the remainder, to acquire an allowlist that&#8217;s written to <em>package deal.json<\/em>.<\/p>\n<div class=\"zox-post-ad-wrap\"><span class=\"zox-ad-label\">Commercial. Scroll to proceed studying.<\/span><\/div>\n<p class=\"wp-block-paragraph\">As soon as the JSON is dedicated, builders utilizing NPM model 11.16.0 or above will obtain warnings if their set up routine executes scripts.<\/p>\n<p class=\"wp-block-paragraph\">Moreover, GitHub explains, Git dependencies (direct or transitive) will now not be resolved at npm set up, except explicitly allowed.<\/p>\n<p class=\"wp-block-paragraph\">\u201cThis closes a code-execution path the place a Git dependency\u2019s <em>.npmrc<\/em> may override the Git executable, even with <em>\u2013ignore-scripts<\/em>,\u201d the platform notes.<\/p>\n<p class=\"wp-block-paragraph\">Equally, dependencies from distant URLs will now not be resolved in NPM model 12. This consists of HTTPS tarballs (direct or transitive), however builders can enable them through the <em>\u2013allow-remote<\/em> flag, which has been accessible since model 11.15.0.<\/p>\n<p class=\"wp-block-paragraph\">\u201cImprove to NPM 11.16.0 or later, run your regular set up, and assessment the warnings. Use <em>npm approve-scripts \u2013allow-scripts-pending<\/em> to see which packages have scripts, approve those you belief, and commit the up to date package deal.json. After that, solely the scripts you permitted preserve working when you improve,\u201d GitHub notes.<\/p>\n<p class=\"wp-block-paragraph\"><strong>Associated:<\/strong> <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/over-5500-github-repositories-infected-in-megalodon-supply-chain-attack\/\">Over 5,500 GitHub Repositories Contaminated in \u2018Megalodon\u2019 Provide Chain Assault<\/a><\/p>\n<p class=\"wp-block-paragraph\"><strong>Associated:<\/strong> <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/supply-chain-attack-hits-32-red-hat-npm-packages\/\">Provide Chain Assault Hits 32 Purple Hat NPM Packages<\/a><\/p>\n<p class=\"wp-block-paragraph\"><strong>Associated:<\/strong> <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/github-confirms-hack-impacting-3800-internal-repositories\/\">GitHub Confirms Hack Impacting 3,800 Inner Repositories<\/a><\/p>\n<p class=\"wp-block-paragraph\"><strong>Associated:<\/strong> <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.securityweek.com\/grafana-says-codebase-and-other-data-stolen-via-tanstack-supply-chain-attack\/\">Grafana Says Codebase and Different Knowledge Stolen through TanStack Provide Chain Assault<\/a><\/p>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>In response to a current wave of provide chain assaults focusing on the NPM ecosystem, GitHub introduced that scripts from dependencies will now not be executed by default. A number of main incidents that occurred over the previous a number of months, primarily related to TeamPCP and the Shai-Hulud self-replicating worm, have been abusing the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":15729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[145,4406,241,1136,2205,1116,1354,9427,240],"class_list":["post-15727","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","tag-attacks","tag-behavior","tag-chain","tag-change","tag-execution","tag-npm","tag-prevent","tag-script","tag-supply"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/15727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15727"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/15727\/revisions"}],"predecessor-version":[{"id":15728,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/15727\/revisions\/15728"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/15729"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69d9690a190636c2e0989534. Config Timestamp: 2026-04-10 21:18:02 UTC, Cached Timestamp: 2026-06-14 19:04:56 UTC -->