The Axios npm Compromise: Three Hours That Poisoned More Than 70 Million Downloads a Week

On March 31, 2026, two new versions of axios — the JavaScript HTTP client that Microsoft Threat Intelligence describes as having over 70 million weekly downloads — were published to npm from the lead maintainer's compromised account. Neither version changed the axios source code. Each one added a single dependency that axios never imports. That dependency's install script fetched a remote access trojan for macOS, Windows and Linux. The malicious versions were live for roughly three hours. GitHub's advisory is blunt about the consequence: any computer that installed the package should be considered fully compromised. This is the record of what happened, what CISA told organisations to do about it, and the controls that would have blunted it.

The timeline, in UTC

According to the maintainer's postmortem in the axios repository (issue #10636) and the analyses that followed it, axios@1.14.1 was published at 00:21 UTC on March 31, 2026, and axios@0.30.4 followed at around 01:00 UTC. Both were published from the lead maintainer's compromised npm account — not through the project's normal release process.

Both versions were removed at about 03:15 UTC the same morning. That leaves a window of just under three hours for the current line, and just over two hours for the legacy line, during which a routine install or update could pull a compromised package.

The last clean versions are axios@1.14.0 and axios@0.30.3. If your lockfiles, caches or CI logs show 1.14.1 or 0.30.4, CISA's guidance treats that as an exposure to investigate — not a near miss to shrug off.

One dependency, never imported

The mechanism matters because it is so quiet. Microsoft Threat Intelligence describes it as dependency insertion: the trusted package's application logic was not modified. Instead, each malicious release added one dependency, plain-crypto-js@4.2.1, that axios never imports at runtime.

A dependency that is never imported can still run code. npm lifecycle scripts execute during installation, and plain-crypto-js carried a postinstall script. On install, that script reached out to actor-controlled infrastructure and fetched a second-stage remote access trojan, with platform-specific payloads for macOS, Windows and Linux. No click, no prompt, no visible change to the axios code a reviewer would diff. The poison was in the manifest, not the library.

That is why CISA's alert, "Supply Chain Compromise Impacts Axios Node Package Manager" (April 20, 2026), frames this as a supply chain compromise rather than a vulnerability in axios itself. The code you audited was fine. The delivery channel was not.

How the maintainer's account was taken

The maintainer's own postmortem says his machine was compromised weeks earlier through a targeted social engineering campaign, and that a long-lived npm token was then abused to publish the malicious versions. Two lessons sit inside that sentence, and both are about credentials rather than code.

First, a long-lived token is a standing key to the release process. Whoever holds it can publish as the maintainer, for as long as it stays valid. Second, the compromise started on a person's machine, not in the registry — the publishing account was the downstream prize, not the entry point.

The postmortem also records the fix the project adopted afterwards: publishing has since moved to OIDC trusted publishing with immutable releases. Trusted publishing replaces a stored, long-lived token with a short-lived credential issued to a specific CI workflow for a specific run. There is no permanent key left on a maintainer's machine to steal, and an immutable release cannot be quietly replaced after the fact.

Attribution, reported as attribution

Attribution in this piece is reported exactly as the vendors stated it, and as nothing more. Google Threat Intelligence attributes the compromise to UNC1069, a group it describes as North Korea-linked. Microsoft Threat Intelligence attributes the infrastructure and the compromise to Sapphire Sleet, which it likewise describes as a North Korean state actor. Different vendors track overlapping activity under different names; that is normal practice in threat intelligence, and the two attributions are presented here as the record those teams published — not as a verdict this article reaches on its own.

What CISA told organisations to do

CISA's remediation guidance is specific, and it is worth following in its own order:

  • Search code repositories, CI/CD pipelines and developer machines that ran npm install or npm update with the compromised versions during the window. Include cached copies in artifact repositories and dependency tools.
  • Pin npm package dependency versions to known safe releases.
  • Downgrade to axios@1.14.0 or axios@0.30.3 and delete node_modules/plain-crypto-js/.
  • If compromised dependencies are identified, revert the affected environment to a known safe state.
  • Rotate and revoke credentials that may have been exposed: version control tokens, CI/CD secrets, cloud keys, npm tokens and SSH keys. For ephemeral CI jobs, rotate every secret that was injected into a compromised run.
  • Mandate phishing-resistant multifactor authentication on developer accounts, especially on critical platforms.
  • Set ignore-scripts=true in the .npmrc configuration file, which prevents install scripts from executing during npm installs.
  • CISA also recommends min-release-age=7 in .npmrc, so installs only accept packages that have been published for at least seven days — a cooling-off period that would have kept a three-hour-old malicious release out entirely.

Read that list once more and notice its shape. Only one item is about axios. The rest are standing controls — pinning, credential rotation, phishing-resistant MFA, script suppression and release-age floors — that reduce the blast radius of the next compromised package, whatever it is.

The defensive lessons that generalise

First, treat install scripts as code execution, because they are. A postinstall hook runs with the installing user's privileges, on developer machines and CI runners that tend to hold exactly the tokens an attacker wants. ignore-scripts=true is a blunt control and it can break legitimate packages that compile native code — which is why it belongs in policy discussions, tested per project, rather than as folklore.

Second, pin and lock. A floating version range is an instruction to trust future publishes automatically. Pinning to known safe releases, committing lockfiles and reviewing dependency changes in the manifest — not just in source diffs — would have made the added plain-crypto-js dependency visible before it ran anywhere.

Third, shorten credential lifetimes. The maintainer's move to OIDC trusted publishing with immutable releases is the structural answer to the exact failure in this incident: no long-lived token on an endpoint, no mutable release to swap. Maintainers of widely depended-on packages carry an outsized target on their accounts; phishing-resistant MFA and short-lived publishing credentials are how that target shrinks.

The bottom line

For roughly three hours on March 31, 2026, one of the most downloaded packages in the JavaScript ecosystem shipped a dependency it never used, whose only job was to install a trojan at install time. The axios source was never touched. The trust was. The fixes on the record — pin to 1.14.0 or 0.30.3, delete the malicious dependency, revert exposed environments, rotate every credential that touched them, and adopt the standing controls CISA lists — are unglamorous, specific and still the correct answer for any team that ran an install that morning.

By Karl Amber

Sources

  • CISA — "Supply Chain Compromise Impacts Axios Node Package Manager" (April 20, 2026): https://www.cisa.gov/news-events/alerts/2026/04/20/supply-chain-compromise-impacts-axios-node-package-manager — the two compromised versions and the injected plain-crypto-js@4.2.1 dependency, the search/pin/downgrade/revert remediation steps, credential rotation (VCS tokens, CI/CD secrets, cloud keys, npm tokens, SSH keys), phishing-resistant MFA, ignore-scripts=true and min-release-age=7 in .npmrc.
  • axios maintainer postmortem — "Post Mortem: axios npm supply chain compromise," axios GitHub issue #10636: https://github.com/axios/axios/issues/10636 — publication from the compromised maintainer account, the maintainer's machine compromised via social engineering weeks earlier, the abused long-lived npm token, and the move to OIDC trusted publishing with immutable releases.
  • Microsoft Threat Intelligence — "Mitigating the Axios npm supply chain compromise" (April 1, 2026): https://www.microsoft.com/en-us/security/blog/2026/04/01/mitigating-the-axios-npm-supply-chain-compromise/ — axios at over 70 million weekly downloads, dependency insertion with axios source unchanged, the postinstall download of a cross-platform remote access trojan, downgrade targets 1.14.0 / 0.30.3 with immediate credential rotation, and Microsoft's attribution to Sapphire Sleet.
  • GitHub Advisory GHSA-fw8c-xr5c-95f9 — the advisory for the compromised axios releases: any computer that installed the affected package should be considered fully compromised.

Editor's note: this article is part of ScanderLoud's Cybersecurity & Networking series. It was researched from primary and authoritative sources — the CISA alert, the axios maintainer's own postmortem, Microsoft Threat Intelligence's analysis and the GitHub advisory listed above — and is original and educational throughout, with a defensive framing. No NetworkChuck video was opened or used.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *