The Axios Supply Chain Attack: A Post-Mortem analysis

Cover Image for The Axios Supply Chain Attack: A Post-Mortem analysis

The Axios Breach: How 100 Million Downloads Became a Vector

On March 31, 2026, the JavaScript ecosystem faced a significant compromise. Axios, the industry-standard HTTP client, was used to distribute a Remote Access Trojan (RAT). The incident lasted only a few hours, but its reach was global.

When: The Timeline

The compromise occurred in a tight window between 00:21 and 03:15 UTC. During this time, two poisoned versions were pushed to the npm registry:

  • v1.14.1
  • v0.30.4

Registry security teams flagged the unusual publishing patterns and removed the versions within three hours, but by then, thousands of automated CI/CD pipelines had already pulled the code.

Who: The Compromise and the Actor

The attack originated from the account takeover of lead maintainer Jason Saayman.

  • The Victim: Saayman’s npm credentials were harvested via a targeted social engineering campaign. The attackers posed as a legitimate firm, tricking him into using a compromised meeting tool that scraped local session tokens.
  • The Attacker: Forensic analysis by Microsoft and Sophos points to North Korean state-sponsored groups (specifically NICKEL GLADSTONE). The infrastructure used to host the malware matched previous campaigns targeting the cryptocurrency and fintech sectors.

Why: Strategic Espionage

This wasn't a simple defacement. The objective was credential harvesting and lateral movement. By infecting a core library, the attackers sought:

  1. Environment Secrets: Automated scraping of .env files and AWS/GCP tokens from developer machines.
  2. Downstream Access: Injecting code into the build processes of major tech companies to compromise their end-users.
  3. Persistence: Setting up backdoors that would allow for remote access long after the initial npm package was deleted.

How: The "Phantom" Dependency

The technical execution avoided direct code changes to the Axios library to bypass manual review. Instead, the attackers used a stolen npm access token to publish directly from a CLI, bypassing GitHub's security oversight.

The attackers injected a 'phantom' dependency into the package.json called plain-crypto-js. It wasn't actually used by the code, but npm's installer executed it anyway.

The attack chain worked as follows:

  1. The Hook: A postinstall script in the hidden dependency triggered a platform-check.
  2. The Payload: Depending on whether the victim used Windows, macOS, or Linux, a specific binary was downloaded. On Windows, this was a PowerShell-based RAT; on Linux, it was a Python script.
  3. The Cleanup: The malware was designed to overwrite the package.json with a clean version immediately after the RAT was deployed, leaving no trace for local developers to find during a routine audit.

Final Thoughts

The Axios breach highlights a fundamental fragility in the modern software supply chain: when a "blindly trusted" dependency is compromised, the fallout is instantaneous. For teams that ran an npm install on March 31, 2026, the standard recovery protocol applies: auditing build logs for anomalies and rotating any secrets exposed to the environment during that window.

Read Next.