TL;DR: npm v12 will block automatic install scripts, Git dependencies, and remote URL dependencies by default, but OXSecurity argues those changes still leave account takeover, native builds, and publish-time intent detection unresolved as Shai-Hulud variants keep evolving. The deeper risk is that platform-level trust controls lag behind attacker adaptation, especially when compromised maintainers can still ship malicious releases.
At a glance
What this is: OXSecurity says npm v12 reduces some install-time exposure, but it does not resolve the deeper supply chain trust problem created by account takeover, native code execution, and malicious package publishing.
Why it matters: For developers and security teams, this means registry defaults alone cannot govern supply chain risk; identity, code provenance, and runtime trust all need separate controls.
Context
npm supply chain security is not just a package-install problem. When maintainers, automation accounts, or build systems are compromised, trust shifts from code content to identity and provenance, and default installation guards arrive too late to matter.
The article’s core governance gap is that platform controls are still reacting to behaviours that attackers have already adapted around. That matters to developers, but it also matters to IAM, PAM, and NHI programmes because registry accounts, CI runners, API keys, and automation tokens are now part of the attack surface.
The Shai-Hulud pattern described here is typical of modern supply chain abuse, not an outlier. Attackers are exploiting legitimate publishing workflows, not exotic exploits, which makes identity assurance and publish-time controls central to the problem.
Key questions
Q: What breaks when npm defaults block install scripts but maintainers are already compromised?
A: The control fails because the malicious code ships as a trusted release, not as an obviously unsafe install script. Once an attacker controls a maintainer account or publishing token, the registry receives code through an authenticated path, so policy at install time no longer addresses the real trust failure. Teams need identity governance and publish-time inspection as well as client-side blocking.
Q: Why do account takeovers make npm supply chain attacks more dangerous than package-level malware?
A: Account takeover turns the registry itself into a delivery channel. The attacker inherits the maintainer’s authority, reputation, and downstream dependency reach, so malicious code is far more likely to be trusted by automation and developers. That is why the identity behind a package matters as much as the code inside it.
Q: What are the signs that a package registry is failing to stop malicious releases?
A: Watch for repeated impersonation names, packages that contain clear exfiltration logic, unusual native build behaviour, and releases that immediately spread into popular dependency chains. If malicious packages can be published, mirrored, and consumed before review catches them, the registry is relying on downstream detection rather than effective upstream governance.
Q: What should teams do first when malicious npm packages execute on trusted developer machines?
A: Treat the host as credential-compromised until proven otherwise. Contain the endpoint, identify what secrets were present at execution time, and rotate cloud tokens, registry credentials, SSH keys, and session material before trusting any subsequent build or deployment activity.
Technical breakdown
Why install-time defaults do not stop compromised maintainers
Install-time hardening only helps when the attacker depends on lifecycle hooks or dependency resolution to execute code. If an adversary already controls a maintainer account, the malicious payload can be shipped as a trusted package release, so the problem shifts from package execution to identity compromise and release integrity. In that model, blocking postinstall scripts and remote dependencies reduces one delivery path, but it does not invalidate the package itself. The deeper issue is that registry trust assumptions are account-centric, while attackers operate at the level of authenticated publishing workflows and signed-looking artifacts.
Practical implication: Treat maintainer account security, token scope, and release provenance as first-order controls, not secondary concerns.
How native builds and require-time execution bypass npm defaults
npm’s new defaults target explicit install-time behaviours, but node-gyp and binding.gyp files can still trigger native builds during install without using ordinary lifecycle scripts. That means code can execute through the build path even when postinstall execution is blocked. There is also a second bypass: malicious code can run when a package is required or imported, because execution then occurs inside the application’s own runtime path rather than the package manager’s script model. Those mechanisms matter because they move execution outside the controls most teams are expecting to rely on.
Practical implication: Review build-time and import-time execution paths separately from lifecycle-script policy.
Why publish-time intent detection matters in supply chain governance
Publish-time intent detection is the missing governance layer when malicious packages are created to look legitimate until they are installed or imported. The article’s example package, anthropic-internal-tools, shows how obvious exfiltration logic can coexist with normal packaging metadata, which makes pure package-format filtering insufficient. Registry operators need better signals on maintainer behaviour, package novelty, suspicious file patterns, credential-theft keywords, and anomalous release timing. Without those controls, the platform is asking every downstream developer to perform code review and malware triage on demand, which does not scale.
Practical implication: Add publish-time inspection and reputation scoring to registry governance, not just client-side installation controls.
Threat narrative
Attacker objective: The attacker aims to turn trusted npm distribution channels into a persistence and exfiltration mechanism that spreads malware across developer and CI environments.
- Entry occurs through compromise of a legitimate maintainer account, API key, or publishing workflow rather than through a traditional exploit.
- Credential access then lets the attacker publish trusted packages, alter downstream dependencies, and use legitimate platforms such as GitHub as part of the delivery chain.
- Impact comes from credential theft, persistence in developer tooling, and repeated downstream infections across CI, IDE, and repository environments.
Breaches seen in the wild
- reviewdog Action compromise 2025: A stolen maintainer token poisoned reviewdog/action-setup, leaking CI secrets including the tj-actions bot token used in the next attack.
- Shai-Hulud npm worm first wave 2025: The first Shai-Hulud wave used stolen npm tokens to trojanise 500+ packages, starting with tinycolor, and leaked developer and CI secrets on GitHub.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Package trust has become an identity problem before it is a malware problem. npm defaults can reduce one class of execution path, but they do not answer who is allowed to publish, who can be impersonated, or which tokens can be abused to ship malicious code. That is why NHI and IAM governance now sit inside software supply chain security, not beside it. Practitioners should treat registry accounts, CI identities, and maintainer tokens as governed identities with lifecycle control, not as incidental credentials.
Publish-time control is the missing layer in registry security. The article shows why postinstall blocking alone cannot keep pace with attackers who already know how to shift to native builds, import-time execution, and platform abuse. A named concept emerges here: publish-time trust gap, the window between package creation and downstream execution where malicious intent can still be invisible. Security teams need controls that inspect the package at publication, not only at install.
Shai-Hulud-style campaigns prove that supply chain attackers iterate faster than platform policy. The article’s repeated references to evasive behaviour, benign platform abuse, and downstream propagation show an operational adversary that learns from each wave. That pattern aligns with MITRE ATT&CK credential access, persistence, and lateral movement, but the more important lesson is governance: once a registry becomes a trusted identity plane, compromise of one identity can cascade into many. Practitioners should redesign trust around containment, not assumed package legitimacy.
Microsoft’s ownership of npm does not remove the practitioner burden, but it does change the accountability model. When a registry sits inside a major platform ecosystem, its security posture becomes part of the identity and supply chain control plane that enterprises inherit. That means buyers should ask whether platform defaults, token governance, and publish-time detection are actually aligned with their risk appetite. The right conclusion is not to distrust npm wholesale, but to stop assuming package install settings alone are a sufficient governance boundary.
Attackers now treat developer platforms as dual-use infrastructure. GitHub, Hugging Face, and npm are being used as both delivery and command infrastructure, which blurs the line between software distribution and operational C2. That matters because conventional perimeter thinking cannot separate benign developer traffic from malicious use of the same platforms. Practitioners should assume registry and repository abuse will continue to be a supply chain pattern, not an anomaly, and govern accordingly.
From our research library:
- 59% of compromised machines in a major 2025 supply chain attack were CI/CD runners rather than personal workstations, according to the State of Secrets Sprawl 2026.
- The blast radius of the Salesloft-Drift OAuth supply chain attack was 10 times greater than earlier incidents in which attackers breached Salesforce directly.
- Read next: AI Supply Chain Security and AI-BOM Guide
What this signals
Publish-time trust gap: registry policy now has to account for package provenance, maintainer identity, and malicious intent before a release reaches consumers. Install-time hardening is still useful, but it is no longer the main control boundary when attackers can shift execution into native builds and import paths.
Enterprises should assume developer platforms are already part of the supply chain attack surface, not just distribution channels. That makes registry governance, CI identity controls, and token lifecycle management part of the same control story as software provenance and dependency review.
For practitioners
- Strengthen maintainer account controls Enforce phishing-resistant MFA, short-lived tokens, and scoped publishing permissions for every package maintainer and release automation identity.
- Inspect build and import execution paths Review packages that use native builds, require-time execution, or dependency resolution paths that can still run code even when lifecycle scripts are blocked.
- Add publish-time package inspection Scan new releases for exfiltration keywords, suspicious file access, impersonation names, and anomalous release patterns before they reach downstream consumers.
- Govern CI and automation identities as NHIs Inventory GitHub Actions, CI runners, publishing bots, and API keys used to distribute software, then apply lifecycle ownership and revocation checks.
- Prepare incident response for registry compromise Define how you will revoke package tokens, rotate developer secrets, and re-baseline infected workstations when a trusted dependency is confirmed malicious.
Key takeaways
- npm v12 reduces some install-time abuse, but it does not resolve account takeover, native build execution, or malicious publishing as supply chain risks.
- The article shows that attackers are iterating quickly enough to move around platform defaults, which leaves downstream teams exposed if they rely on installation policy alone.
- Practitioners need identity governance for maintainers and automation, plus publish-time inspection and revocation playbooks, to limit the blast radius of malicious releases.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, CIS Controls v8 and SLSA set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | The article centers on stolen tokens and exfiltration from trusted package workflows. |
| NHI-03 — Vulnerable Third-Party NHI | Compromised maintainer and automation identities are the supply chain entry point here. | |
| NHI-07 — Long-Lived Secrets | The attack depends on tokens that remain valid long enough to publish and persist. | |
| Recommendation — Scan registries and CI paths for exposed secrets and revoke any leaked NHI credentials immediately. Track third-party publishing identities as governed NHIs and review their access and trust boundaries. Replace long-lived publishing tokens with short-lived credentials and enforce rapid revocation. | ||
| MITRE ATT&CK | TA0006; TA0008 — Credential Access; Lateral Movement | The article describes credential theft followed by propagation through trusted developer channels. |
| Recommendation — Map package compromise activity to credential access and lateral movement to prioritise detection coverage. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | Registry and automation access needs tighter entitlement control to stop trusted misuse. |
| Recommendation — Apply PR.AA-05 to limit who can publish, sign, and manage software supply chain identities. | ||
| CIS Controls v8 | CIS-5 — Account Management | Account lifecycle and revocation are central to preventing maintainer takeover and token abuse. |
| Recommendation — Use CIS-5 to inventory, review, and remove stale publishing accounts and automation identities. | ||
| SLSA | L3 — Provenance and tamper resistance | The article is about software supply chain integrity and trusted release provenance. |
| Recommendation — Adopt SLSA provenance controls to make package publication and downstream consumption more verifiable. | ||
Key terms
- Publish-Time Trust Gap: The window in which a package can be published with malicious intent before downstream controls see anything wrong. In registry security, this gap matters because install-time blocking does not stop a trusted maintainer from shipping harmful code as an apparently legitimate release.
- Supply Chain Identity: The collection of credentials, tokens, workflow permissions, and publishing rights that let software move from source to deployment. In NHI terms, it is the identity layer of the pipeline, and when it is weak, compromise can propagate through legitimate automation rather than obvious malware channels.
- Native Build Bypass: A technique where malicious code executes through build tooling such as node-gyp and binding.gyp rather than through obvious lifecycle scripts. This matters because policy focused only on install hooks can miss code that runs as part of a normal-looking build path.
- Registry Abuse: The misuse of a software package registry as a delivery, persistence, or command channel for malicious code. In modern supply chain attacks, the registry is not just storage; it is a trust broker, and abuse of that trust can propagate compromise widely.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity, and secrets management. It helps security and identity practitioners connect identity controls to supply chain risk, registry abuse, and automation governance.
Published by the NHIMG editorial team on August 2, 2026.
Updated on October 13, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org