Bottom line: npm blocks automatic package installation scripts by default starting with version 12, a practice that competitors like Yarn, pnpm, and Bun had already established.
GitHub is changing the default setting for automatic script execution in npm version 12 (July release): pre- and post-install scripts will only be executed with explicit activation going forward. This is intended to reduce a frequently exploited attack surface for supply-chain attacks, but does not eliminate them entirely.
With npm V12, the “allowScripts” setting is set to “off”. This means concretely: npm install will no longer automatically execute preinstall, install, or postinstall scripts from dependencies unless explicitly enabled in the project. Implicit node-gyp builds triggered by a binding.gyp file are also affected. Prepare scripts from git, file, and link dependencies are likewise blocked.
Security analysts and developers welcome the change in principle, but point out that it eliminates only one attack vector. Sonu Kapoor, maintainer of the CVE Lite CLI in the OWASP Incubator Project, emphasizes: the change removes a major automatic execution path, but does not preclude other attack routes – from malicious code at runtime through compromised maintainer accounts to dependency confusion and manipulated GitHub Actions workflows. Alan Parkinson, director of security firm Threat Detective, adds that sophisticated attackers have long since abandoned this gap, and reliance on automatic script execution is primarily used by less sophisticated threat actors.
GitHub engineer Zach Steindler justifies the change with the volume and pace of supply-chain attacks: security research shows that secure default settings are necessary for broad adoption. The principle is not new – Yarn, pnpm, and Bun already block third-party installation scripts by default. Npm is thus following an established standard that competitors implemented years earlier in some cases.
Source: www.csoonline.com · Published June 11, 2026
Lumi AI News — AI-assisted curation pursuant to Art. 50 EU AI Act. Paraphrase and classification by Lumi News Pipeline v1.6.5.