Technical Tip: How FortiCNAPP protects from the Axios npm supply chain attack and remote access trojan
| Description | This article describes a supply chain attack targeting the axios npm package, the most popular JavaScript HTTP client library with over 100 million weekly downloads. On March 31, 2026, two malicious versions (axios@1.14.1 and axios@0.30.4) were published to the npm registry via a compromised maintainer account. The malicious releases inject a hidden dependency on a trojanized package called plain-crypto-js@4.2.1, which deploys a cross-platform remote access trojan (RAT) targeting macOS, Windows, and Linux.
The attack was operationally sophisticated: the malicious dependency was pre-staged 18 hours in advance with a clean decoy version to establish publishing history. Both the 1.x and 0.x release branches were poisoned within 39 minutes of each other. The dropper uses a double-layer obfuscation scheme (XOR cipher + reversed Base64), contacts a command-and-control server at sfrclak[.]com:8000, downloads platform-specific second-stage RAT payloads, and then self-destructs by deleting itself and replacing its own package.json with a clean stub to evade forensic detection.
The malicious versions were live for approximately 2–3 hours (00:21–03:29 UTC) before npm removed them. Any system that ran npm install during this window and pulled the affected versions should be treated as fully compromised. | |||||||||||||||||||||
| Scope | Affected versions:
axios (npm):
plain-crypto-js (npm):
Additional Compromised Packages:
Safe Versions:
Advisory IDs:
Attack Vector: Supply chain compromise via hijacked npm maintainer account; triggered automatically on npm install via post-install hook. Potential Impact: Full remote access trojan deployment (macOS, Windows, Linux), credential theft, arbitrary code execution, and lateral movement.
Indicators of Compromise (IOCs):
In-depth information can be found at: | |||||||||||||||||||||
| Solution | FortiCNAPP automatically detects affected packages found in user environments via the Vulnerability Management Component and Code Security Component. FortiCNAPP will also detect Potentially Compromised Hosts and alert via Composite Alerts.
To mitigate this vulnerability, users of affected packages should immediately downgrade to safe versions and audit their environments for indicators of compromise.
Immediate remediation:
Pin versions and prevent transitive resolution to malicious releases:
Remove the malicious dependency and enforce lockfile integrity:
Check for RAT artifacts on affected systems:
Block C2 traffic at the network/DNS layer:
Note: If any RAT artifact is found, treat the system as fully compromised. Do not attempt to clean in place—rebuild from a known-good state. Rotate all credentials on any system where the malicious package ran: npm tokens, AWS access keys, SSH private keys, cloud credentials (GCP, Azure), CI/CD secrets, and any values present in .env files accessible at install time. |
