Axios npm Package Compromised: North Korean Hackers Target 100M Weekly Downloads

Admin7 min read
temp-1775411973925.webp
A sophisticated North Korean state-sponsored attack compromised the widely-used axios JavaScript library through fake Microsoft Teams messages, putting millions of applications at risk. The malicious code was live for three hours before removal in March 2026.

A North Korean state-sponsored group compromised axios, a JavaScript library downloaded 100M+ times weekly, through a fake Microsoft Teams error that stole maintainer credentials—exposing millions of apps for 3 hours.

Introduction

On March 31, 2026, one of the most widely-used JavaScript libraries fell victim to a sophisticated supply chain attack that put millions of applications at risk. The axios npm package—downloaded over 100 million times weekly—was compromised through an elaborate social engineering scheme that began with a fake Microsoft Teams error message. According to Microsoft Security Blog, the attack was attributed to Sapphire Sleet, a North Korean state-sponsored threat actor.

This incident represents a critical escalation in supply chain attacks, demonstrating how sophisticated adversaries are increasingly targeting the open-source ecosystem's most trusted components. With axios serving as a fundamental HTTP client library used across countless web applications, enterprise systems, and cloud services, the potential blast radius of this compromise extended to organizations worldwide. Google Threat Intelligence Group confirmed that malicious versions were available for approximately three hours before removal, during which time thousands of systems may have been compromised.

The Attack Timeline and Social Engineering

The Deceptive Entry Point

The attack began with a highly sophisticated social engineering campaign targeting Jason Saayman, the primary maintainer of the axios package. According to The Hacker News, the threat actor group UNC1069 presented what appeared to be a legitimate Microsoft Teams authentication error, prompting the maintainer to install what was described as a necessary SDK update. In reality, this "update" was a Remote Access Trojan (RAT) designed specifically to harvest npm credentials.

The social engineering proved remarkably effective. When another maintainer, Burellier, declined to install the fake Teams update and suggested rescheduling the meeting, the attackers immediately removed him from Slack workspaces and deleted conversation histories—a clear indicator of malicious intent that only became apparent in hindsight.

Account Compromise and Publication

Once the RAT malware was installed on Saayman's system, the attackers gained remote access and extracted npm credentials, including a long-lived access token for the axios project. Elastic Security Labs documented the precise timeline of the compromise:

  • March 31, 2026, 00:21 UTC: axios@1.14.1 published to npm registry

  • March 31, 2026, 01:00 UTC: axios@0.30.4 published (tagged as "legacy")

  • Account email changed to ifstap@proton.me

  • Both malicious versions removed approximately three hours after initial publication

Technical Anatomy of the Attack

The Phantom Dependency Technique

The malicious axios versions employed a sophisticated technique known as a "phantom dependency" attack. Both compromised versions injected a dependency called plain-crypto-js@4.2.1 into their package manifests. According to Trend Micro's analysis, the attackers had pre-staged this malicious package 18 hours before publishing the poisoned axios versions, demonstrating careful operational planning.

The attack sequence worked as follows:

// Malicious dependency added to package.json
{
  "dependencies": {
    "plain-crypto-js": "^4.2.1",
    // ... other legitimate dependencies
  }
}

Multi-Stage Payload Delivery

The plain-crypto-js package contained a postinstall hook that executed during the npm installation process. Huntress researchers documented that this hook deployed a cross-platform RAT capable of targeting Windows, macOS, and Linux systems simultaneously. The malware performed several critical operations:

  1. Initial execution: Postinstall script triggered automatically during npm install

  2. Payload deployment: RAT malware downloaded from attacker-controlled command and control (C2) infrastructure

  3. Credential harvesting: Exfiltration of environment variables, API keys, authentication tokens, and npm credentials

  4. Evidence erasure: Malicious files replaced with clean decoys to evade detection

  5. Persistence establishment: Backdoors installed for continued access

Critical Warning: The malware's ability to replace its own files with clean versions after installation makes traditional file-based detection methods ineffective. Systems that installed the compromised versions during the three-hour window should be considered fully compromised.

Evasion and Obfuscation

The attackers demonstrated advanced evasion capabilities. By establishing plain-crypto-js@4.2.0 as a legitimate-looking package before introducing malicious code in version 4.2.1, they created publishing history that reduced scrutiny. The package name itself was chosen to appear benign—mimicking the popular crypto-js library with a "plain" prefix that suggested a simplified variant.

Impact Analysis and Scope

Scale of Potential Compromise

The axios package's ubiquity in the JavaScript ecosystem makes this attack particularly severe. With over 100 million weekly downloads and usage across virtually every sector—from financial services to healthcare, e-commerce to government systems—the number of potentially affected applications is staggering. Snyk's analysis indicates that any application with automatic dependency updates or those that installed axios during the critical three-hour window faced immediate compromise.

Severity Assessment

  • Data Exfiltration Risk: CRITICAL - Environment variables containing database credentials, API keys, OAuth tokens, and other secrets were prime targets

  • Supply Chain Implications: CRITICAL - Demonstrates that even the most trusted packages with millions of users can be weaponized

  • Lateral Movement Potential: HIGH - Compromised developer machines could serve as entry points to corporate networks

  • Operational Impact: HIGH - Organizations face potential compliance violations, data breaches, and customer trust erosion

Attribution and Motivation

Multiple security vendors, including Microsoft and Google, attributed this attack to North Korean state-sponsored actors, specifically the group tracked as Sapphire Sleet (also known as UNC1069 and associated with the broader Lazarus Group umbrella). The sophistication of the social engineering, operational security, and technical implementation align with previous campaigns attributed to these actors, which typically pursue both financial gain and strategic intelligence collection.

Detection and Response

Immediate Version Verification

Organizations must immediately audit their dependencies to identify exposure. Use the following commands to check for compromised versions:

# Check installed axios version
npm list axios

# For yarn users
yarn why axios

# Check all projects recursively
find . -name "package.json" -exec grep -H "axios" {} \;

Look specifically for versions 1.14.1 or 0.30.4. Additionally, examine lock files (package-lock.json or yarn.lock) for any references to plain-crypto-js.

Automated Scanning Tools

Deploy multiple layers of detection to ensure comprehensive coverage:

  • npm audit: Run npm audit in all project directories to identify known vulnerabilities

  • Snyk: Provides real-time alerts for supply chain compromises with detailed remediation guidance

  • Socket Security: Monitors package behavior and detects suspicious postinstall scripts

  • GitHub Dependabot: Automated dependency scanning with pull request generation for updates

Runtime and Infrastructure Monitoring

Systems that may have been exposed require comprehensive forensic analysis:

  • Review application logs for unusual outbound connections to unfamiliar IP addresses

  • Monitor for unexpected data exfiltration patterns or bandwidth spikes

  • Examine process execution logs for npm postinstall script activity during the March 31 timeframe

  • Check for unauthorized API calls or authentication token usage

  • Inspect file modification timestamps in node_modules directories

Mitigation and Recovery

Immediate Remediation Steps

  1. Update to safe versions: Upgrade to axios version 1.7.7 or later (the last legitimate release before the compromise was 1.7.7)

  2. Remove compromised packages: Explicitly exclude malicious versions in package.json

  3. Rebuild dependencies: Delete node_modules and lock files, then reinstall from scratch

  4. Verify lock files: Ensure package-lock.json reflects only safe versions

# Complete dependency refresh
rm -rf node_modules package-lock.json
npm install axios@1.7.7
npm install

Credential Rotation Protocol

Assume Breach: Any system that installed the compromised versions should be treated as fully compromised. All credentials accessible to that system must be rotated immediately.

  1. Rotate all API keys, authentication tokens, and service credentials

  2. Review access logs for unauthorized activity using potentially compromised credentials

  3. Update all environment variables and configuration secrets

  4. Revoke and reissue SSH keys, certificates, and other cryptographic materials

  5. Reset passwords for services accessed from compromised systems

Long-Term Security Improvements

Organizations should implement comprehensive supply chain security measures to prevent future incidents:

  • Version pinning: Use exact version specifications rather than semver ranges

  • Lock file enforcement: Use npm ci in CI/CD pipelines to ensure reproducible builds

  • Dependency scanning: Integrate automated security scanning into development workflows

  • Network segmentation: Isolate build systems from production environments

  • Least privilege: Limit npm token permissions and use short-lived credentials where possible

Lessons Learned and Future Implications

The axios compromise demonstrates that supply chain attacks have evolved beyond opportunistic malware injection to sophisticated, state-sponsored operations targeting critical infrastructure. Bitdefender's technical advisory notes that this attack's success hinged on exploiting the trust relationship between developers and familiar tools like Microsoft Teams.

The incident underscores several critical realities: open-source maintainers face increasingly sophisticated threats, social engineering remains the weakest link in security chains, and the npm ecosystem's trust model requires fundamental reevaluation. As Singapore's Cyber Security Agency emphasized in their advisory, organizations must adopt defense-in-depth strategies that assume compromise rather than trust by default.

Moving forward, the industry must invest in better maintainer security training, multi-party publishing controls, and automated behavioral analysis for package repositories. The axios incident serves as a stark reminder that in the modern threat landscape, your security is only as strong as your least-protected dependency.

Axios npm supply chain attacknpm security breachSapphire SleetJavaScript supply chain attacknpm package compromiseMicrosoft Teams phishingNorth Korean cyber attackopen source securityaxios