Lead Summary: Critical axios npm Supply Chain Attack Discovered
A severe supply chain attack has targeted the widely-used axios npm package, leading to the distribution of malicious versions (1.14.1 and 0.30.4) that silently installed Remote Access Trojans (RATs) on developer systems. The attack, discovered in March 2026, originated from a compromised maintainer account, allowing attackers to inject a hidden malicious dependency. Developers are urged to immediately audit their projects, downgrade to safe versions, and scan their systems for potential compromise.
Incident Overview: axios Supply Chain Compromise
axios is a popular, promise-based HTTP client for the browser and Node.js, renowned for its ease of use, robust features, and widespread adoption across millions of projects. Its ubiquity made it a prime target for a supply chain attack, as compromising axios allows attackers to potentially infect a vast number of downstream applications and development environments.
The incident began when an attacker gained unauthorized access to a maintainer’s account on the npm registry. This access was then used to publish new, seemingly legitimate versions of axios that contained hidden malicious code.
Attack Execution: How the Malicious Package Spread
The attack was executed with precision, leveraging a multi-stage approach to evade detection and deliver its payload:
- Maintainer Account Compromise: An
axiosmaintainer’s npm account was compromised, granting the attacker the ability to publish new package versions. - Malicious Version Publication: The attacker published two new versions,
1.14.1and0.30.4, to the npm registry. These versions appeared legitimate but contained critical modifications. - Hidden Malicious Dependency: Within these malicious
axiosversions, a new, seemingly innocuous dependency was added to thepackage.jsonfile. This dependency was a custom-crafted package under the attacker’s control. postinstallScript Injection: The malicious dependency’spackage.jsonincluded apostinstallscript. This script is automatically executed by npm (or yarn) after the package is installed.- Remote Access Trojan (RAT) Installation: The
postinstallscript silently downloaded and executed a Remote Access Trojan (RAT) onto the developer’s system. This RAT provided the attacker with persistent remote access, potentially allowing for data exfiltration, further system compromise, or lateral movement within development networks.
The following diagram illustrates the attack flow:
Affected Versions and Impact
The malicious versions specifically targeted were axios@1.14.1 and axios@0.30.4. Any project that installed or updated to these versions during the window of compromise is at risk.
| Package Name | Malicious Versions | Status | Impact |
|---|---|---|---|
axios | 1.14.1 | Removed | Installs RAT |
axios | 0.30.4 | Removed | Installs RAT |
The primary impact is the installation of a Remote Access Trojan (RAT) on any system where these malicious axios versions were installed. This grants attackers unauthorized control over the affected development environment, posing severe risks including:
- Sensitive Data Theft: Source code, API keys, credentials, and other proprietary information.
- Further Compromise: Using the compromised system as a pivot point for attacks on internal networks or other services.
- Backdooring Applications: Injecting malicious code into applications being developed, leading to broader supply chain attacks.
- Intellectual Property Loss: Theft of trade secrets and proprietary algorithms.
Current Status & Remediation Efforts
Upon discovery, the npm security team swiftly intervened. The malicious versions 1.14.1 and 0.30.4 of axios have been unpublished from the npm registry. This prevents new installations or updates from fetching the compromised packages. The legitimate maintainers of axios are actively collaborating with security researchers and npm to investigate the full extent of the compromise and reinforce security measures.
An official, clean version of axios has been republished, and developers are advised to update to the latest secure release or revert to known-good versions immediately.
What Developers Should Do Immediately
Given the severity of this attack, developers must take immediate action to protect their systems and projects:
- Audit
package-lock.jsonoryarn.lock:- Check your project’s lock files (
package-lock.jsonfor npm oryarn.lockfor Yarn) for any references toaxios@1.14.1oraxios@0.30.4. - Use
npm list axiosoryarn list axiosto identify the installed version.
- Check your project’s lock files (
- Downgrade or Update
axios:- If any affected version is found, immediately remove it and install a known-good version.
- To downgrade:
npm uninstall axios && npm install axios@1.14.0(oraxios@0.30.3for the older major version line). - Alternatively, update to the latest secure version:
npm update axios --forceornpm install axios@latest. - After updating, delete
node_modulesand your lock file, then reinstall dependencies:(or equivalent for Yarn)rm -rf node_modules package-lock.json npm install
- Scan Affected Systems:
- Perform a thorough malware scan on any development machine that might have installed the malicious versions.
- Consider re-provisioning or isolating affected machines if a RAT is confirmed.
- Rotate Credentials:
- Assume any credentials (API keys, cloud access keys, git tokens, etc.) stored or used on a compromised development machine might be exposed. Rotate them immediately.
- Implement Stricter Supply Chain Security:
- Use
npm auditoryarn auditregularly. - Consider tools for dependency integrity verification, such as
npm ciin CI/CD pipelines to ensure lock files are used strictly. - Review and approve dependencies, especially new ones, before integrating them into critical projects.
- Monitor for changes in maintainer accounts or unexpected package updates.
- Use
References
- npm Security Advisory (Hypothetical)
- Axios Official GitHub Repository (Hypothetical Security Notice)
- Security Research Blog Post (Hypothetical)
Transparency Note: This news digest describes a hypothetical npm axios supply chain attack as if it occurred in March 2026. All details regarding the attack, affected versions, and remediation steps are fabricated for the purpose of this exercise. No actual axios maintainer accounts have been compromised, and the specified malicious versions do not exist. The references provided are illustrative placeholders.