GitHub released npm version 12 with install scripts disabled by default, a major change targeting supply chain attacks through malicious package installation routines. The npm package manager previously executed installation scripts automatically during package downloads, creating an attack surface for threat actors injecting malware into the software supply chain.

With allowScripts now defaulting to off, developers must explicitly enable script execution for each package installation. This forces conscious decision-making around which packages can run arbitrary code on developer machines and build systems. The change addresses real threats: attackers have compromised legitimate npm packages to execute malicious scripts during installation, stealing credentials and injecting backdoors into applications.

GitHub simultaneously deprecated granular access tokens (GATs), which allowed users to bypass two-factor authentication protections. This removes a significant authentication weakness in the npm ecosystem. GATs previously provided elevated permissions while circumventing 2FA, creating a pathway for account takeover if tokens leaked or were stolen.

The install script restriction carries practical implications for development workflows. Packages relying on post-install compilation or setup routines will require manual script execution or configuration changes. Maintainers and developers must audit their dependencies and decide which packages genuinely require execution privileges during installation. This introduces friction but eliminates a silent attack vector.

These changes reflect evolving threats in package management. Recent campaigns have targeted npm users directly, compromising accounts to distribute malware through trusted packages. The 2023 attacks on PyTorch and XZ Utils demonstrated how supply chain compromises can reach thousands of downstream users rapidly.

Organizations should review npm configurations and test deployment pipelines with the new defaults enabled. Teams relying on packages with post-install scripts need to either enable allowScripts selectively or migrate to alternatives that don't require installation-time code execution. The security tradeoff favors explicit trust over automatic script execution, reducing the blast radius if a package becomes compromised.