The images in this article were generated with artificial intelligence. How we publish
GitHub and the npm team have decided to tighten the default behavior of the package installer: in npm v12 The installation scripts will be deactivated by default and the resolution of units from remote Git or URLs repositories shall be restricted unless explicitly authorized by the developer. The measure seeks to close one of the most exploited routes in attacks to the supply chain: the automatic execution of code during "npm install" by means of life cycle hooks (pre-install, install, post-install and prepare).
The change responds to a real and common risk: a committed package at any point in the transitional chain can run code on the developer machine or in a CI runner. Many projects, libraries and tools depend on scripts that run automatically when installing dependencies, and that default trust is what attackers have used to insert back doors or run malicious payloads in development and deployment environments.

The practical implications are dual. On the one hand, improving safety by requiring the explicit approval of the execution of scripts and the resolution of unregistered sources; on the other hand, it may break up building and development flows which today depend on automatic native compilations (node-gyp), prepare scripts from Git references, or packages installed from remote tarballs. Equipment and projects using units with native compilation or direct references to repositories will have to be adapted.
GitHub recommends preparing already by updating to npm 11.16.0 or more, running a normal installation and reviewing the warnings that npm shows. The tool offers an approval flow with npm approved, which allows to review, approve the trust scripts and compromise the changes to the package.json so that only the approved ones continue to run after going up to npm v12. It's an opportunity to consciously audit which packages really need to run code locally.
As practical measures to reduce the impact and improve the security of your supply chain, consider the following: test changes in an isolated branch and in CI runners before migrating; update CI images or containers to include the new version of npm; avoid Git or remote dependencies without justification and, if needed, explicitly authorize them; prioritize the use of lockfiles and fixed versions; and treat with special care the packages that make native compilation (node-gyp), as npm can block implicit rebuildings.

In addition, it integrates complementary controls: it enables the analysis of dependencies and alerts (for example, Dependabot or Snyk) to detect suspicious changes, it requires human verification for relevant pull requests, it enables 2FA and publishing policies in the npm register for the maintainers, and it retains evidence of origin with SBOM and signatures where possible. GitHub's good practice documentation on supply chain security is a good starting point: https: / / docs.github.com / en / code-security / supply-chain-security.
To understand exactly which scripts and behaviors will be affected it is appropriate to read the official npm documentation on scripts and lifecycle hooks; this helps to identify in your tree of dependencies where scripts are run and which ones you need to explicitly approve: https: / / docs.npmjs.com / cli / v12 / using-npm / scripts. Adjust the pre-launch window to audit and reduce the attack surface: less reliable default scripts = less unauthorised execution risk.
In short, npm v12 represents a significant advance in protecting the JavaScript supply chain by converting an extension of tacit confidence into an explicit permit. The teams that take these measures with additional planning, testing and control will reduce their exposure to supply-chain attacks while avoiding unexpected interruptions in their construction and deployment processes.
Related
More news on the same subject.

Campaign at Hugging Face Spaces and GitHub uses game traps to steal passwords and sessions
A massive campaign has used Hugging Face Spaces pages and GitHub repositories to attract players with supposed traps and bots and push them to install malware that steals browse...

Canada detects NEXCOL intrusion and suspension of export permits
The Canadian government confirmed that its online system to manage permits for the export of military material and strategic goods, known as NEXCOL, suffered an intrusion detect...

CertiK shows Weight2Shell: identical weights, different outputs by inference environment
CertiK security researchers have demonstrated a technique - called Weight2Shell in their report - that allows two instances of the same artificial intelligence model, carrying i...

RabbitMQ: critical failure in the management interface exposes tokens OAuth2; patches 4.4.1 / 4.3.8
A critical vulnerability in RabbitMQ allows an attacker who has access to the management interface to get tokens OAuth2 signed by the identity provider without credentials and t...

Critical Vulnerability in Erlang / OTP client TLS allows MITM without certificate (CVE-2026-124286)
A critical vulnerability to the client implementation of TLS within Erlang / Open Telecom Platform (OTP) allows a malicious server to complete a TLS 1.2 handshake without presen...

pCloud Pass: cyber attack exposes emails from few users; undecipher encrypted vaults
This week pCloud Pass, the password manager integrated into the Swiss pCloud service, confirmed that it was the target of a "cyber attack" after several users reported early log...

SOCRadar identifies WeaveLotus / RedOps campaign in intrusions to Thailand and the Philippines
SOCRadar has published an analysis that attributes a series of intrusions to military, government and legislative institutions in South-East Asia to a set of tools and activitie...