Conceptual image representing cybersecurity threats related to Attackers Trojanize Axios HTTP Library in Highest-Impact npm Supply Chain Attack

The Axios HTTP library sits at the heart of modern JavaScript development, processing approximately 100 million npm downloads every week. This isn't just another JavaScript package - it's the foundation that enables web applications to communicate with servers, APIs, and cloud services across virtually every industry vertical. (Source: Csoonline)

When attackers compromised Axios on March 31, they didn't just breach a single tool. They gained potential access to 80% of cloud and code environments, according to cloud security firm Wiz. The library appears as a direct dependency in nearly 175,000 other npm projects, creating a cascade effect that touches everything from banking applications to healthcare portals to e-commerce platforms.

Key Insight: When attackers compromised Axios on March 31, they didn't just breach a single tool.

Consider what Axios actually does in your production environment. Every time your application needs to fetch user data, process payments, authenticate users, or sync with cloud services, it likely routes those requests through Axios. The library handles HTTP communications for both frontend frameworks and backend services, meaning a compromised version could intercept API keys, authentication tokens, customer data, and internal communications flowing between your systems.

The sophistication of this attack reveals why business leaders should care about supply chain security. Attackers didn't randomly target Axios - they selected it precisely because of its ubiquity and trusted status. With malicious code executing in approximately 3% of impacted environments according to Wiz's observations, thousands of development machines potentially exposed credentials, source code, and access to production systems within the two to three hour window before npm removed the packages.

The financial implications extend beyond immediate breach costs. Development teams discovering the trojanized versions This email address is being protected from spambots. You need JavaScript enabled to view it..1 or This email address is being protected from spambots. You need JavaScript enabled to view it..4 in their environments face complete system rebuilds. Every credential must be rotated, every access token revoked, and every connected system audited for potential lateral movement. For organizations running continuous integration pipelines, the malware could have propagated from development to staging to production environments automatically.

Key Insight: Every credential must be rotated, every access token revoked, and every connected system audited for potential lateral movement.

What makes this particularly concerning for enterprises is the attack's attribution to North Korean threat actor UNC1069 by Google's Threat Intelligence Group. State-sponsored actors bring different motivations than typical cybercriminals - they seek intellectual property, strategic intelligence, and long-term persistent access rather than quick financial gains. John Hultquist, chief analyst with GTIG, noted that North Korean hackers have "deep experience with supply chain attacks, which they've historically used to steal cryptocurrency."

The remote access trojan deployed through the compromised Axios versions demonstrates platform-agnostic capabilities, targeting Windows, macOS, and Linux systems simultaneously. On compromised machines, the malware establishes persistence, collects system information including hostnames, usernames, and running processes, and maintains command-and-control communication every 60 seconds. This level of access enables attackers to exfiltrate source code, pivot to connected systems, and maintain long-term presence in corporate networks.

Beyond traditional development environments, the proliferation of AI coding assistants like Claude Code and OpenAI Codex amplifies the risk. These tools frequently pull packages from npm for various tasks, potentially exposing non-technical employees who use AI assistants for automation and productivity tasks. A marketing analyst using an AI tool to process data could unknowingly execute malicious npm packages, extending the attack surface beyond IT departments.

The Attack Chain: How Attackers Gained Control and What They Injected

The attack began approximately 18 hours before the Axios compromise when attackers created their staging infrastructure. An account named nrwise published a seemingly benign package called plain-crypto-js@4.2.0 to establish registry history and avoid immediate suspicion. This clean decoy served as the foundation for what would become a sophisticated supply chain attack targeting one of JavaScript's most critical libraries.

The real payload arrived later that same day in plain-crypto-js@4.2.1, which contained a postinstall hook designed to execute a dropper script whenever another package pulled it in as a dependency. This preparation phase demonstrates the attackers' operational sophistication - they pre-staged their malicious dependency hours in advance, creating what appeared to be legitimate version history.

Shortly after midnight UTC on March 31, the attackers struck. They published This email address is being protected from spambots. You need JavaScript enabled to view it..1 to npm, followed by This email address is being protected from spambots. You need JavaScript enabled to view it..4 just 39 minutes later. Both versions contained a critical modification: their package.json files now listed plain-crypto-js@4.2.1 as a dependency, while keeping all other components unchanged. This technique, known as a phantom dependency, involves adding a package to the manifest that has zero actual usage in the codebase - a high-confidence indicator of compromise according to StepSecurity researchers.

The attackers gained control through a compromised npm account belonging to Axios's lead maintainer, Jason Saayman. While the project's 1.x releases were configured to use npm's OIDC Trusted Publisher mechanism bound to GitHub Actions, the malicious 1.14.1 release was published manually via a stolen token with no corresponding commit or tag in the repository. Saayman later acknowledged that the v0.x branch still relied on a legacy long-lived token, and a community member discovered that even the v1.x publish workflow passed NODE_AUTH_TOKEN to npm, which takes precedence over OIDC when both are present.

Once installed, the obfuscated and encrypted postinstall script contacted a command-and-control server on a domain the attackers had registered just one day earlier. The script then downloaded platform-specific remote access trojan (RAT) payloads tailored to the victim's operating system.

On macOS systems, the binary was written to /Library/Caches/com.apple.act.mond and could self-sign injected payloads using codesign --force --deep --sign, effectively bypassing macOS Gatekeeper protections. Windows machines received a PowerShell script copied to %PROGRAMDATA%\wt.exe, masquerading as Windows Terminal, which established persistence through a registry Run key named "MicrosoftUpdate" and a re-download batch file. Linux systems got a Python script stored as /tmp/ld.py executed via nohup python3.

The RAT supported four commands: peinject for deploying additional binaries, runscript for executing shell or AppleScript code, rundir for directory enumeration, and kill for self-termination. Each variant fingerprinted the compromised system, collecting hostname, username, operating system version, boot and install times, CPU architecture, and running processes before reaching out to the C2 server every 60 seconds.

After execution, the malware attempted to erase its tracks by deleting setup.js, removing the malicious package.json containing the postinstall hook, and replacing it with a clean copy reporting version 4.2.0 instead of 4.2.1. This anti-forensic technique meant users running npm list would see the older, legitimate version number, potentially misleading them into believing their installation predated the attack window.

Axios Supply Chain Attack Timeline

T-18 hours (March 30)
Infrastructure Staging
Attackers create account nrwise and publish benign package plain-crypto-js@4.2.0 to establish registry history and avoid suspicion.
Same day (March 30)
Payload Deployment
Release plain-crypto-js@4.2.1 containing malicious postinstall hook with dropper script, ready to execute when pulled as dependency.
March 31, 00:00+ UTC
Account Compromise
Gain control of Jason Saayman's npm account using stolen legacy token. Bypass OIDC Trusted Publisher mechanism through manual publication.
March 31, Shortly after midnight
Attack Execution
Publish compromised This email address is being protected from spambots. You need JavaScript enabled to view it..1 and This email address is being protected from spambots. You need JavaScript enabled to view it..4 (39 min later) with phantom dependency to malicious package.
Post-installation
RAT Deployment
Obfuscated script contacts C2 server (registered 1 day prior), downloads platform-specific RAT payloads. macOS binary written to /Library/Caches/com.apple.act.mond.

Immediate Detection and Response: What to Do Right Now

Security teams need to take immediate action to identify and contain potential Axios compromises in their environments. The window between infection and detection averaged just two to three hours, but automated build processes and developer workstations may have pulled the malicious versions during that critical period.

Today: Audit Your Dependency Trees

Start by checking all projects for the compromised versions using npm list axios in each project directory. Look specifically for This email address is being protected from spambots. You need JavaScript enabled to view it..1 and This email address is being protected from spambots. You need JavaScript enabled to view it..4. The malware's anti-forensic capabilities mean you cannot trust what appears in package.json files - the attackers replaced malicious manifests with clean ones after execution.

Run npm list plain-crypto-js to detect the malicious dependency. Even if it shows version 4.2.0, this could indicate compromise since the malware downgrades its reported version after running. Check your npm cache as well with ls ~/.npm/_cacache/content-v2 and search for plain-crypto-js artifacts.

Examine system locations where the RAT payloads persist. On macOS, check for /Library/Caches/com.apple.act.mond. Windows systems should look for %PROGRAMDATA%\wt.exe masquerading as Windows Terminal, plus a registry Run key named "MicrosoftUpdate". Linux environments need to search for /tmp/ld.py and any Python processes launched via nohup.

This Week: Contain and Remediate

If you find evidence of compromise, assume total environment breach. The RAT supports peinject commands for deploying additional binaries, runscript for executing shell or AppleScript code, and rundir for directory enumeration. Security teams observed execution in roughly 3% of impacted environments according to Wiz's telemetry.

Monitor network traffic for connections to the attacker's command-and-control infrastructure. The malware beacons every 60 seconds, collecting hostname, username, OS version, boot times, CPU architecture, and running processes. Block outbound connections to domains registered in the days before March 31.

Update to clean Axios versions immediately, but verify authenticity first. Check that releases appear both on npm and as tagged releases in the official GitHub repository. Legitimate v1.x releases use npm's OIDC Trusted Publisher mechanism bound to GitHub Actions - manual publications without corresponding commits indicate compromise.

Long-Term: Harden Your Supply Chain

Implement npm ci --ignore-scripts in all CI/CD pipelines to prevent postinstall hooks from executing during automated builds. This would have blocked the plain-crypto-js dropper from running when pulled as a dependency.

Configure npm's minimumReleaseAge setting to enforce package age policies. Setting this to even 24 hours would have prevented this attack since plain-crypto-js existed for less than a day before being weaponized. Add "npmrc": {"minimumReleaseAge": "1 day"} to your package.json.

The incident exposed a critical gap: even when security firms detected the malicious package within minutes, the project's core collaborator lacked permissions to remove it because the attacker controlled higher-privilege tokens. Organizations should establish emergency response procedures that don't depend on a single maintainer's availability during off-hours.

Detection Indicators: How to Identify Compromised Systems

Security teams hunting for Axios compromise artifacts need to look beyond standard package manifests, as the attackers implemented anti-forensic measures that actively disguise their presence. The malware replaces its own traces after execution, making traditional dependency audits insufficient for detection.

On macOS systems, the primary indicator is a binary written to /Library/Caches/com.apple.act.mond. This location mimics Apple's legitimate cache structure but contains an executable that self-signs injected payloads using codesign --force --deep --sign commands. Your endpoint detection systems should flag any unsigned binaries attempting to invoke codesign with these specific parameters, as legitimate Apple processes don't self-sign in this manner.

Windows environments present a different signature. The malware drops a PowerShell script masquerading as Windows Terminal at %PROGRAMDATA%\wt.exe. This is particularly deceptive because wt.exe normally resides in the WindowsApps directory, not ProgramData. Additionally, check for a registry Run key named "MicrosoftUpdate" - note the lack of space between Microsoft and Update, which differs from legitimate Windows update entries.

Linux systems receive a Python script at /tmp/ld.py executed through nohup. Monitor process trees for any nohup python3 commands spawning from npm postinstall hooks, as this combination rarely occurs in legitimate operations. The script name "ld.py" deliberately mimics the Linux dynamic linker (ld) to avoid scrutiny during casual process inspection.

Network behavior provides another detection vector. The malware contacts its command-and-control infrastructure every 60 seconds, creating a distinctive heartbeat pattern in your network logs. Look for regular outbound HTTPS connections to recently registered domains - the attackers' C2 domain was created just one day before the attack. Your SIEM should flag any development machine establishing persistent connections to domains younger than 30 days.

The malware's fingerprinting routine collects specific system information including hostname, username, OS version, boot times, install times, CPU architecture, and running processes. This creates a unique sequence of system API calls that security tools can detect. Monitor for rapid successive queries to these system properties originating from processes spawned by npm.

Perhaps most telling is what the malware does after execution. It deletes setup.js, removes the malicious package.json containing the postinstall hook, and replaces it with a clean version reporting plain-crypto-js@4.2.0 instead of 4.2.1. This version downgrade behavior - where an installed package reports an older version than what was initially downloaded - serves as a high-confidence indicator of this specific attack.

The RAT component supports four distinct commands that generate identifiable patterns. The "peinject" command deploys additional binaries, "runscript" executes shell or AppleScript code, "rundir" performs directory enumeration, and "kill" triggers self-termination. Security teams should monitor for these command strings in process arguments and network traffic, particularly when associated with the file paths mentioned above.

Memory forensics reveals another detection opportunity. The malware's double-obfuscation technique leaves distinctive deobfuscation routines in memory that persist even after the initial dropper deletes itself. These memory artifacts remain detectable for hours after initial infection, providing a window for incident response even when file-based indicators have been removed.

Supply Chain Lessons: Preventing the Next Attack

The Axios incident exposes fundamental weaknesses in how organizations manage open-source dependencies, particularly the disconnect between security controls and actual developer workflows. Traditional package management approaches assume a level of trust that modern supply chain attacks systematically exploit.

The attackers' use of phantom dependencies - packages that appear in manifest files but have zero actual usage in the codebase - reveals a critical blind spot in dependency auditing. Most security tools scan for known vulnerabilities in packages but don't flag suspicious dependency patterns. When plain-crypto-js appeared in Axios with no corresponding imports or function calls, automated systems treated it as legitimate simply because it existed in package.json.

Package age represents another overlooked control point. The malicious plain-crypto-js package existed for less than 24 hours before being weaponized, yet nothing prevented its immediate adoption by a package with 100 million weekly downloads. npm's minimumReleaseAge setting could have blocked this attack entirely, but few organizations even know this configuration exists, let alone enforce it across their development environments.

The compromise also highlights the fragility of maintainer account security. Despite Axios configuring OIDC Trusted Publisher mechanisms for version 1.x releases, the presence of a legacy NODE_AUTH_TOKEN in the publish workflow meant the system defaulted to token-based authentication instead of the intended GitHub Actions binding. This configuration error - where security features exist but aren't actually active - appears across countless npm packages maintained by small teams or individual developers.

Lock files, often promoted as dependency security silver bullets, proved insufficient here. While lock files prevent unexpected version changes, they don't protect against compromised versions that developers explicitly install during the attack window. Organizations running npm install rather than npm ci in their CI/CD pipelines further weaken this control by allowing lock file modifications during builds.

The two-to-three hour detection window demonstrates both the effectiveness of registry monitoring and its limitations. Security firms detected the malicious packages within minutes, but removal required manual intervention by the npm team. During that window, automated build systems, developer workstations, and even AI coding assistants pulled the compromised versions. The attack's timing - occurring during the lead maintainer's nighttime - meant that even rapid community response couldn't immediately revoke the compromised publishing credentials.

Private registries and dependency proxies offer stronger controls but require significant infrastructure investment. Organizations using tools like Artifactory or Nexus can implement approval workflows, vulnerability scanning, and package quarantine periods before dependencies reach production systems. However, these solutions often conflict with developer velocity expectations, leading to bypass mechanisms that attackers can exploit.

The sophistication of the malware's anti-forensic capabilities - replacing malicious package.json files with clean versions after execution - means post-compromise audits miss infections entirely. Security teams checking installed packages see plain-crypto-js@4.2.0 instead of the malicious 4.2.1, creating false confidence in system integrity. This technique defeats most compliance scanning tools that rely on manifest inspection rather than behavioral analysis.

Axios Supply Chain Attack: Exploitation Timeline

T-24 hours
Package Creation
Malicious plain-crypto-js package created on npm registry with zero prior history
No Age Validation
T-0
Account Compromise
Attacker exploits NODE_AUTH_TOKEN instead of OIDC, bypassing GitHub Actions security
Legacy Token Active
T+Minutes
Phantom Dependency
plain-crypto-js injected into package.json with no actual code imports or usage
No Usage Validation
T+2 hours
Mass Distribution
100M weekly downloads begin pulling compromised version, lock files ineffective
npm install vs npm ci
T+3 hours
Manual Removal
Security firms detect attack, npm team manually removes packages from registry
Detection Window

Table of contents

Top hits