TL;DR: Two malicious Axios npm releases were published with a hidden dependency that executed at install time and could expose developer workstations, CI/CD secrets, and production credentials, according to CYCOGNITO. The incident shows that dependency trust must be treated as a runtime security problem, because postinstall execution can turn package installs into immediate compromise paths.
At a glance
What this is: This is an analysis of a malicious Axios npm supply chain attack that used stolen maintainer credentials and install-time execution to drop a RAT across developer and CI/CD environments.
Why it matters: It matters because identity and secrets exposure in build systems can rapidly turn a package compromise into wider access across NHI, IAM, and software delivery controls.
By the numbers:
- Axios is the most widely used HTTP client in the JavaScript ecosystem, with over 300 million weekly downloads.
- Consumer Discretionary accounted for 22.4% of observed impacted assets in CyCognito's dataset.
👉 Read CYCOGNITO's analysis of the Axios npm supply chain attack
Context
The core issue is not just a bad package, but the trust model that allows code to execute during installation. When a dependency can run a postinstall hook, package acquisition becomes an execution event, and any credentials present on the machine are immediately in scope. In identity terms, this is a secrets exposure problem that crosses developer endpoints, CI/CD systems, and workload access paths.
Axios is a common dependency precisely because it sits inside everyday delivery workflows, which makes compromise blast radius much larger than a single application. The attack also demonstrates why build-time controls must cover non-human identities such as npm tokens, cloud keys, SSH keys, and pipeline credentials. That starting position is typical for modern JavaScript supply chain attacks, not an edge case.
Key questions
Q: What breaks when install-time scripts are allowed in dependency pipelines?
A: Install-time scripts let a dependency execute before the application even runs, which turns package retrieval into code execution. That breaks the assumption that a successful install is only a software supply event. In practice, any secrets available to the build process, including tokens and keys, can be exposed before defenders notice the malicious package.
Q: Why do maintainer credentials make npm supply chain attacks so dangerous?
A: Maintainer credentials are effectively publishing identities, so reuse or theft lets an attacker publish malicious updates under a trusted package name. That bypasses ordinary dependency trust and can spread rapidly across downstream consumers, especially when package ownership controls and token lifecycle management are weak.
Q: How do security teams know whether developer endpoints are leaking NHI secrets?
A: Look for unexpected token use, unusual outbound connections, unexplained browser profile access, and persistence mechanisms on workstations and build runners. If a compromised package executed on the machine, assume cloud keys, CI secrets, and other non-human credentials may already be exposed and rotate them before restoring trust.
Q: What should teams do in the first 24 to 72 hours after suspected package compromise?
A: Teams should isolate affected hosts, preserve forensic evidence, rotate exposed credentials, and inspect repositories for unauthorized workflow or package changes. They should also review internal mirrors and caches, because malicious versions may persist there after public removal. The goal is to stop reuse of stolen identities before the attacker expands access.
Technical breakdown
Why install-time hooks create a hidden execution path
npm packages can define lifecycle scripts such as postinstall, which run automatically when a dependency is installed. That means a malicious package does not need the application to start or the user to click anything. If the package is trusted by the build system, the script runs with the privileges and environment of the installing process, which often includes access to secrets, network reachability, and inherited tokens. In this case, the hidden dependency used that path to drop a RAT and call back to an attacker server before removing traces.
Practical implication: treat install-time script execution as an execution control problem, not just a dependency management issue.
How stolen maintainer credentials expand supply chain impact
Package ecosystem compromise often starts with identity compromise rather than code flaws. If an attacker obtains a maintainer's credentials, they can publish a malicious version that appears legitimate to automated update flows and dependency resolvers. That makes the human identity behind the package a security boundary, and the package registry becomes a privileged distribution channel. Once the malicious version is in place, downstream build systems may ingest it automatically, especially when lock files are refreshed or version ranges are broad.
Practical implication: protect maintainer accounts with phishing-resistant authentication and tighten publish workflow controls around privileged package identities.
Why CI/CD secrets turn a package compromise into access expansion
A compromised build host is not just an endpoint infection. CI/CD runners routinely hold pipeline tokens, deployment credentials, cloud access keys, signing material, and access to source repositories. A RAT on that machine can harvest those non-human identities and use them to move from a single package install into broader infrastructure access. Because the exposure happens at install time, systems that only built or cached dependencies during the window are still at risk even if production code never ran.
Practical implication: assume build-time compromise exposes secrets that must be rotated, not just endpoints that must be cleaned.
Threat narrative
Attacker objective: The attacker wanted persistent access to developer and pipeline environments so they could steal secrets and pivot into broader infrastructure.
- Entry occurred when attackers published malicious Axios versions to npm using stolen maintainer credentials.
- Credential access expanded through install-time execution, where the postinstall hook dropped a RAT and harvested secrets from the build environment.
- Impact followed through persistent remote access to developer and CI/CD systems, creating exposure for source code, cloud credentials, and deployment tokens.
Breaches seen in the wild
- Shai Hulud npm malware campaign — Shai Hulud campaign: npm malware exposed secrets on GitHub.
- Reviewdog GitHub Action supply chain attack — reviewdog/action-setup GitHub Action supply chain attack exposed secrets.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Install-time execution is the real control boundary: package supply chain attacks are not only about malicious code, they are about when code is allowed to run. A postinstall hook turns dependency retrieval into immediate execution, which collapses the distinction between install and compromise. That means dependency governance must treat lifecycle hooks as privileged behaviour, not routine metadata. Practitioners should control installation paths as tightly as runtime execution paths.
Secrets exposure in build systems is a non-human identity failure mode: this attack matters because the compromised machine was only the first target. Once a RAT lands on a developer workstation or runner, the real prize is the collection of API keys, cloud tokens, SSH keys, and CI credentials already present. The control gap is not just weak endpoint hygiene, but insufficient scoping and lifecycle management for non-human identities in delivery pipelines. Teams need to understand that build infrastructure is part of identity governance, not a separate security silo.
Package registries are now identity distribution infrastructure: registry trust depends on maintainer account integrity, release workflow assurance, and detection of anomalous publishing. The malicious Axios release succeeded because the registry and downstream tooling accepted the package as ordinary software distribution. That is why supply chain security, IAM, and secrets management should be managed together rather than as separate controls. The practitioner conclusion is to harden package publishing identities with the same discipline used for privileged admin access.
Build compromise has a wider blast radius than endpoint compromise: a compromised installer can reach source code, deployment credentials, and production infrastructure even when the final application is never executed. This creates a governance blind spot where teams focus on runtime service accounts but ignore the credentials present during build and package resolution. The named concept here is install-time trust collapse, and it should be treated as a category-level risk for modern software delivery. Practitioners should assume any build host with secrets is a high-value identity target.
Removal from the registry is not remediation: registry takedown limits further exposure, but it does not remove already harvested secrets or revoke already abused access. That means incident response must focus on credential rotation, build log review, and rebuild-from-known-good actions. The control lesson is simple: supply chain containment is only the first step, and identity remediation is what actually closes the breach path.
From our research:
- The average estimated time to remediate a leaked secret is 27 days, despite 75% of organisations expressing strong confidence in their secrets management capabilities, according to The State of Secrets in AppSec.
- From our research: Organisations maintain an average of 6 distinct secrets manager instances, creating fragmentation that undermines centralised control, according to The State of Secrets in AppSec.
- From our research: See Top 10 NHI Issues for the governance failures that let secrets sprawl persist across build and runtime environments.
What this signals
Install-time trust collapse: the Axios case shows that software delivery pipelines now need identity controls at the point of package execution, not just at account login. The practical response is to treat build runners as privileged identity zones and align package policy with controls in the OWASP Non-Human Identity Top 10.
The operational signal is that secrets governance must extend into developer workflows, because a package compromise can expose access long before a security team sees a traditional alert. Teams should prioritise secret discovery, rotation, and build isolation together, using lifecycle guidance from 52 NHI Breaches Analysis.
For practitioners
- Audit install logs and lock files immediately Search package-lock.json, CI/CD logs, and dependency caches for the malicious Axios versions and any other suspicious install-time dependencies. Use the findings to scope which runners, developer workstations, and build containers were exposed.
- Rotate every secret present during installation Assume the installer could read cloud access keys, npm tokens, SSH keys, and deployment credentials present on the host at the time of compromise. Revoke and reissue those credentials from a clean environment, then validate downstream access paths.
- Disable lifecycle scripts in CI where possible Run npm ci --ignore-scripts in automated build environments unless a package is explicitly approved to execute scripts. Pair that restriction with dependency allowlisting and alerting on any package that attempts privileged install-time behaviour.
- Rebuild compromised systems from known-good sources Do not clean infected hosts in place when install-time execution has occurred. Reimage the machine or runner, restore from trusted artefacts, and confirm that no persistent access tokens remain on the rebuilt system.
Key takeaways
- The Axios attack shows how install-time execution can convert a package update into immediate compromise of developer and CI/CD environments.
- The most damaging outcome is not the malicious package itself, but the exposure of cloud keys, tokens, and other non-human identities already present on the build host.
- Containment only works when teams rotate affected secrets, rebuild from trusted artefacts, and remove unrestricted install-time script execution from pipelines.
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, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | Install-time secret exposure and rotation failure are central to this attack pattern. |
| MITRE ATT&CK | TA0006 , Credential Access; TA0003 , Persistence | The RAT harvested credentials and created persistent access in build environments. |
| NIST CSF 2.0 | PR.AC-1 | Build and package trust decisions are access control decisions in delivery pipelines. |
| NIST SP 800-53 Rev 5 | IA-5 | Secret theft from runners and workstations directly implicates authenticator management. |
| CIS Controls v8 | CIS-5 , Account Management | Maintainer and pipeline account abuse sits at the centre of the attack path. |
Map malicious dependency execution to TA0006 and TA0003, then prioritise controls around credential theft and persistence.
Key terms
- Install-Time Trust Inversion: Install-time trust inversion is the security failure that happens when an environment executes unreviewed dependency code before validating whether it is safe. The trust decision happens too early, allowing a compromised package to act with higher privilege than the reviewer intended.
- Postinstall Hook: A package lifecycle script that runs automatically after installation. Attackers abuse it because it executes without user interaction, can inherit build credentials, and is often overlooked in review processes that focus on application source rather than dependency behaviour.
- Non-Human Secret: A non-human secret is a credential used by software, services, or infrastructure instead of a person. Examples include tokens, API keys, certificates, and service credentials. These secrets require lifecycle controls because they often provide persistent, high-trust access to systems and data.
- Build Runner: A build runner is the machine or container that executes automated development tasks such as installs, tests, packaging, and deployment. Because it often has access to tokens and service credentials, it should be treated as a privileged NHI environment rather than disposable infrastructure.
What's in the full analysis
CYCOGNITO's full analysis covers the operational detail this post intentionally leaves for the source:
- Affected package versions, exposure window analysis, and asset-scoping guidance for developer and CI/CD environments
- The platform's breakdown of impacted asset categories and sector exposure patterns
- Recommended rebuild and credential-rotation workflow details for teams handling suspected compromise
- Indicator review guidance for package-lock files, pipeline logs, and dependency caches
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, secrets management, and workload identity for practitioners managing modern identity risk. It helps security and platform teams align delivery workflows with identity controls that reduce exposure across build and runtime environments.
Published by the NHIMG editorial team on August 20, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org