Axios npm package compromised to deliver a cross-platform RAT
The compromised Axios versions delivered a single remote access trojan implemented for macOS, Windows, and Linux with an identical C2 protocol.
Security & privacy Elastic Security Labs 1 Apr 2026 Attack Real-world evidence
Published as “Inside the Axios supply chain compromise - one RAT to rule them all”
Why it matters
The compromise demonstrates that a single npm supply-chain breach can deliver a unified cross-platform backdoor to millions of systems.
Summary
Elastic Security Labs observed that a maintainer account for the popular axios npm package was hijacked and two malicious versions were published. The backdoored packages use a postinstall hook to download and execute platform-specific stage-2 implants written in PowerShell, C++ and Python. All three implants share the same C2 protocol, command set, beacon interval and a hard-coded IE8/Windows XP user-agent. The dropper also deletes itself and overwrites its package.json to hide evidence.
What they found 1
- The malicious JavaScript deploys platform-specific stage-2 implants for macOS, Windows, and Linux
“The malicious JavaScript deploys platform-specific stage-2 implants for macOS, Windows, and Linux”
Caveats 4
- The Windows implementation has in-memory execution with no file drop but without disabling AMSI, which will likely be flagged by security tools.
- Only three platform implementations (PowerShell, C++, Python) were observed.
- Detection relies on a hard-coded IE8/Windows XP user-agent string that is trivially detectable on modern hosts.
- The Windows variant's persistence (registry run key + batch file) survives the kill command unless explicitly cleaned up.
What’s new here 4
- First public disclosure of a supply-chain compromise of the widely used axios npm package.
- Identification of a single cross-platform RAT implemented in three native languages but sharing an identical C2 protocol.
- Discovery of anti-forensic techniques that delete the dropper and swap package.json after execution.
- Release of detection rules for the malicious postinstall hook and the hard-coded user-agent fingerprint.