By NHI Mgmt Group Editorial TeamBased on WorkOS: “The Axios npm supply chain attack: What every developer needs to know” (April 1, 2026)

TL;DR: A hijacked npm maintainer account turned Axios into a supply chain weapon, and malicious versions executed a cross-platform RAT during a two-to-three-hour exposure window, according to WorkOS. Lockfiles, provenance, and script controls help, but this incident shows that package identity trust still breaks faster than most teams can detect it.


At a glance

What this is: This is a supply chain compromise of Axios in npm that used a hijacked maintainer account and a malicious dependency to deliver a cross-platform RAT.

Why it matters: It matters because developers, CI/CD runners, and downstream applications inherit trust in package identity, so one compromised maintainer account can rapidly turn routine installs into enterprise-wide exposure.

By the numbers:

  • Axios has over 100 million weekly npm downloads, making the compromise a broad downstream exposure event.

Context

Axios was compromised through the npm supply chain, not through a vulnerability in application code. The security issue is identity trust: if package ownership, token security, and publish provenance are weak, downstream install processes can be abused as a delivery channel for malware.

For developer platforms and CI/CD pipelines, this is a machine identity problem as much as a software integrity problem. Package maintainer accounts, registry tokens, and automated installs form a trust chain that must be governed like any other privileged access path.

The article shows how quickly that trust can fail when a maintainer account is taken over and a malicious dependency is introduced into a widely used package. That makes this incident a strong example of why software supply chain governance now overlaps directly with NHI controls.


Key questions

Q: How should security teams respond when a trusted npm maintainer account is compromised?

A: Treat the maintainer account as a privileged publishing identity, not a normal developer login. Revoke publication access, verify recent releases, quarantine new package versions, and rotate any tokens that could have been used by CI or automation. The key control is to stop trust propagation before the malicious version is consumed downstream.

Q: Why do supply chain compromises create such a large downstream impact?

A: Because the attacker is not targeting one endpoint, but a distribution mechanism used by many projects at once. A single poisoned package can reach CI/CD runners, developer machines, and production build systems before defenders notice the change.

Q: How can teams tell whether npm install is being used as an execution path?

A: Look for lifecycle scripts, unexpected outbound connections during install, and new transient dependencies that were not present in the reviewed package tree. Those are signs that dependency resolution is crossing into runtime behaviour.

Q: Should organisations prioritise lockfiles or provenance checks first?

A: Lockfiles reduce version drift immediately, while provenance checks strengthen trust in who built and published a package. Teams need both, but lockfile enforcement usually delivers the fastest containment because it blocks surprise upgrades right away.


Technical breakdown

How npm maintainer account takeover enables package poisoning

The attack began with compromise of the maintainer account used to publish Axios. Once an attacker controls publishing identity, they do not need to break the package itself. They can add a new dependency, change the publish target, or alter package metadata so that ordinary installs fetch malicious code. In npm ecosystems, publishing rights, tokens, and registry trust become the control plane. If those credentials are long-lived or insufficiently bound to a narrow workflow, the attacker can use the legitimate package distribution path as an abuse channel. This is why package identity governance is part of supply chain security, not just account security.

Practical implication: govern npm publish credentials as privileged NHI and restrict who can publish what, when, and from where.

Why postinstall scripts are such an effective delivery mechanism

The malicious dependency executed through a postinstall script, which runs automatically during package installation. That matters because install-time execution happens before most teams inspect the code or complete build verification. A postinstall hook can fingerprint the host, contact external infrastructure, stage a second payload, and then clean up local artefacts. In JavaScript ecosystems, lifecycle scripts are effectively an execution path embedded inside dependency resolution. Unless teams suppress or tightly control them, package installation is not a passive fetch operation but a runtime execution event. This is why dependency trust and code execution are tightly coupled in npm.

Practical implication: suppress or tightly allowlist lifecycle scripts for packages that are not explicitly trusted.

Why lockfiles and provenance reduce blast radius but do not eliminate trust gaps

Lockfiles reduce surprise by pinning exact versions, and provenance helps tie a published package to a source and build workflow. Those controls lower the chance that a fresh install silently picks up a poisoned release. They do not, however, solve the core identity problem if an attacker already controls a trusted publisher or if automated update tools accept the malicious version before human review. Provenance strengthens integrity, but it does not replace maintainer account governance, token hygiene, or install-time script controls. The underlying challenge is that package trust is distributed across identity, registry, and build systems.

Practical implication: combine pinning, provenance, and token governance instead of treating any single control as sufficient.


Threat narrative

Attacker objective: The objective was to turn a trusted open-source package into a malware distribution channel that exposed developer and CI/CD credentials at scale.

  1. Entry occurred when the attacker compromised the npm maintainer account associated with Axios, apparently through a stolen long-lived access token.
  2. Credential abuse followed when the attacker used that trusted publishing identity to publish malicious package versions and introduce a hidden dependency.
  3. Impact occurred when npm install executed the payload, which delivered a RAT capable of credential theft, reconnaissance, and persistent access on affected systems.
  • 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.
  • Nx s1ngularity attack 2025: Attackers stole Nx's npm token via a GitHub Actions flaw and shipped malware that stole 2,349 secrets and abused developers' AI CLIs.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Package identity trust is now a control boundary, not a metadata detail. The Axios compromise shows that publishing rights, registry tokens, and dependency trust can be used as an execution path. Once a maintainer account is taken over, the package name itself becomes the delivery mechanism. The implication is that software supply chain governance and NHI governance are now the same problem surface in different forms.

Standing publisher credentials create a supply chain blast radius problem. This attack worked because a long-lived npm token appears to have granted durable publishing power beyond what the maintainer likely needed at that moment. That is a classic overprivilege pattern, but in package ecosystems it turns into mass downstream exposure. Practitioners should treat publish tokens as privileged access that must be tightly scoped and lifecycle-governed.

Postinstall execution is an assumption collapse, not just a script risk. Install-time scripts assume dependency code can execute safely inside the build path. That assumption fails when a package can be substituted after publication or when a new dependency arrives without scrutiny. The implication is that many build pipelines still trust package installation as if it were a read-only operation, which it is not.

Lockfiles reduce version drift, but they do not solve trust in the publisher. Version pinning can prevent accidental upgrades to a malicious release, yet it cannot protect teams that rely on fresh installs, automatic dependency updates, or compromised maintainers. The real governance gap is not just version selection. It is the absence of end-to-end assurance over who can publish, how they prove provenance, and what executes during install.

Supply chain security now depends on machine identity discipline. The same lifecycle questions that apply to service accounts now apply to package publishers, CI runners, and automation tokens. When those identities are long-lived, over-scoped, or poorly monitored, a single compromise can cascade into many downstream environments. The practitioner conclusion is simple: publish authority must be governed as carefully as production access.

From our research library:

What this signals

Package provenance must be treated as a governance control, not a nice-to-have signal. When a maintainer account can be used to publish malicious code into a trusted package namespace, the relevant question is not just whether the artifact is signed. It is whether the identity behind that artifact can still be trusted to act within its intended scope.

CI/CD runners are now a primary exposure plane for supply chain compromise. They often hold cloud credentials, deployment tokens, and repository secrets, which means a poisoned dependency can turn routine builds into credential-harvest events. Teams should review build identities, not just developer endpoints, because install-time execution frequently lands there first.


For practitioners

  • Harden npm publishing identities Replace long-lived classic tokens with short-lived, granular publishing credentials and require strong account protection for maintainers. Treat registry access as privileged access, not a convenience workflow.
  • Block unexpected lifecycle execution Disable or tightly allowlist npm lifecycle scripts in CI/CD and developer workflows so package install does not automatically become code execution.
  • Enforce lockfile discipline Use committed lockfiles and install with npm ci so build systems consume only reviewed package versions and fail when lockfiles drift.
  • Verify package provenance before trust Require provenance signals for new or sensitive package releases and investigate any version that appears without a verifiable build lineage.
  • Monitor for dependency anomalies Watch for new transitive packages, unexpected dependency changes, and install-time network callbacks that indicate a poisoned release path.

Key takeaways

  • The Axios compromise shows that package trust can be broken through maintainer account takeover and malicious dependency publication, not just through vulnerable application code.
  • The attack reached widely used environments because a trusted npm package with over 100 million weekly downloads can propagate downstream very quickly.
  • Lockfiles, provenance, and script controls reduce exposure, but the decisive control gap is still identity governance over who can publish and what executes during install.

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 SP 800-53 Rev 5 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-03 — Vulnerable Third-Party NHIThe compromise began with a trusted package maintainer identity used as a third-party publishing channel.
NHI-04 — Insecure AuthenticationA long-lived npm token likely enabled the maintainer account takeover described in the article.
NHI-07 — Long-Lived SecretsThe article points to a long-lived classic access token as the likely entry point.
Recommendation — Assess third-party package publishers as NHI dependencies and verify their account controls before trusting releases. Replace long-lived registry tokens with stronger authentication and narrower credential scope for publishing identities. Eliminate long-lived publishing secrets and rotate any token that can still authorize package releases.
MITRE ATT&CKTA0006;TA0010 — Credential Access; ExfiltrationThe malware aimed to steal credentials after install-time execution on developer and CI systems.
Recommendation — Map install-time payloads to credential access and exfiltration techniques in your detections and triage.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementRegistry tokens and publish credentials are authenticators that need lifecycle control.
Recommendation — Apply authenticator management to rotate, scope, and revoke package publishing credentials promptly.

Key terms

  • Package Publishing Identity: The account, token, or workflow that authorises a software package release into a registry. In practice, this identity behaves like a privileged non-human identity because compromise lets an attacker publish trusted code to many downstream consumers.
  • Lifecycle Script: A lifecycle script is code that runs automatically during package installation or build steps, such as preinstall or postinstall hooks. These scripts are useful for legitimate automation but create a high-risk execution path because they can run before developers fully inspect the package.
  • Provenance Attestation: A provenance attestation is evidence that software was produced through a known pipeline or workflow. It helps verify origin, but it does not guarantee that the workflow was free of compromise, poisoned caches, or attacker-controlled inputs.
  • Supply Chain Blast Radius: Supply chain blast radius is the amount of downstream infrastructure an attacker can affect after compromising one dependency or build step. In dependency-rich systems, a flaw in a common library can reach repositories, signing systems, cloud resources, and customer-facing services if permissions are not tightly separated.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 6, 2026.
Updated on October 7, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org