✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: March 31, 2026
  • 6 min read

Axios npm supply‑chain attack: hidden RAT in malicious versions

The Axios npm supply‑chain attack was a maintainer‑account hijack that led to two poisoned releases (axios 1.14.1 and axios 0.30.4) which inject a hidden dependency that runs a post‑install script delivering a cross‑platform Remote Access Trojan (RAT).

Axios Supply Chain Attack Diagram

What Happened on March 31 2026?

On 31 March 2026 the open‑source JavaScript HTTP client axios was compromised. A threat actor hijacked the npm account of the library’s primary maintainer, published two malicious versions, and slipped a covert plain-crypto-js dependency into the release. The dependency’s postinstall hook drops a multi‑platform RAT that silently contacts a command‑and‑control (C2) server.

For a full technical write‑up, see the original story. Below we break down the timeline, the code, the impact, and how you can protect your supply chain with UBOS homepage solutions.

Attack Summary

  • Who: Maintainer account jasonsaayman was compromised and email changed to a throw‑away ProtonMail address.
  • When: Malicious releases pushed at 00:21 UTC (axios 1.14.1) and 01:00 UTC (axios 0.30.4) on 31 Mar 2026.
  • How: Attacker added a fake runtime dependency plain-crypto-js@4.2.1 that contains a postinstall script (setup.js).
  • What: The script decodes obfuscated strings, detects the host OS, fetches a platform‑specific payload from http://sfrclak.com:8000/6202033, executes it, and then self‑destructs.

Technical Deep‑Dive & Indicators of Compromise

Hidden Dependency – plain-crypto-js@4.2.1

The malicious package mimics the legitimate crypto-js library, reusing the same author name and description to avoid suspicion. Its package.json includes:

{
  "name": "plain-crypto-js",
  "version": "4.2.1",
  "scripts": { "postinstall": "node setup.js" },
  "main": "index.js"
}

The setup.js file is a two‑layer obfuscated payload that:

  1. Loads an encoded array stq[] containing all strings (C2 URL, OS identifiers, file paths).
  2. Decodes them at runtime using custom XOR and Base64 functions (_trans_1 and _trans_2).
  3. Detects os.platform() and branches to macOS, Windows, or Linux payloads.
  4. Contacts the C2 server, downloads the second‑stage binary, executes it, and finally deletes setup.js and the original package.json, replacing it with a clean stub.

Platform‑Specific Payloads

Platform Dropper Command Persistence Path
macOS (darwin) osascript <temp_file> /Library/Caches/com.apple.act.mond
Windows (win32) cscript //nologo <temp.vbs> %PROGRAMDATA%\wt.exe
Linux / Other nohup python3 /tmp/ld.py & /tmp/ld.py

Key Indicators of Compromise (IOCs)

  • Malicious npm packages: axios@1.14.1 (sha1 = 2553649f2322049666871cea80a5d0d6adc700ca) and axios@0.30.4 (sha1 = d6f3f62fd3b9f5432f5782b62d8cfd5247d5ee71).
  • Hidden dependency: plain-crypto-js@4.2.1 (sha1 = 07d889e2dadce6f3910dcbc253317d28ca61c766).
  • C2 domain: sfrclak.com (IP = 142.11.206.73).
  • Network traffic pattern: POST to http://sfrclak.com:8000/6202033 with bodies packages.npm.org/product0, product1, or product2.
  • Filesystem artifacts: /Library/Caches/com.apple.act.mond, %PROGRAMDATA%\wt.exe, /tmp/ld.py.

Impact & Affected Versions

Axios is one of the most downloaded npm packages (300 M+ weekly downloads). The two poisoned releases were live for roughly 12 hours before the community flagged them, exposing any project that performed a routine npm install axios during that window.

Projects that depend on either the modern 1.x line or the legacy 0.x line are at risk. The following commands help you verify exposure:

# List installed axios versions
npm list axios | grep -E "1\.14\.1|0\.30\.4"

# Look for the hidden dependency
ls node_modules/plain-crypto-js && echo "Potentially compromised"

If you find the hidden folder, the post‑install script has already executed, even if the package.json now appears clean.

Step‑by‑Step Remediation

  1. Pin safe versions immediately.
    # Modern line
    npm install axios@1.14.0
    
    # Legacy line
    npm install axios@0.30.3
    
  2. Remove the malicious dependency.
    rm -rf node_modules/plain-crypto-js
    npm install --ignore-scripts
    
  3. Enforce --ignore-scripts in CI/CD. Update your pipeline configuration (GitHub Actions, GitLab CI, Azure Pipelines) to run npm ci --ignore-scripts for every build.
  4. Rotate all secrets. Regenerate npm tokens, cloud API keys, SSH keys, and any environment variables that may have been present during the install.
  5. Block the C2 domain. Add firewall rules or host‑file entries:
    # Linux iptables
    iptables -A OUTPUT -d 142.11.206.73 -j DROP
    
    # Hosts file (macOS/Linux)
    echo "0.0.0.0 sfrclak.com" >> /etc/hosts
    
  6. Rebuild compromised hosts. If any of the artifact paths exist, treat the machine as fully compromised and redeploy from a known‑good image.
  7. Audit your dependency graph. Use tools like Workflow automation studio to generate a full SBOM and verify no other hidden dependencies exist.

How UBOS Secures Your Supply Chain

UBOS offers a multi‑layered defense that would have stopped the Axios attack before it reached production:

  • Real‑time npm monitoring: Our UBOS platform overview continuously scans new package versions, flags suspicious post‑install scripts, and blocks them by default.
  • Package cooldown windows: Newly published packages are held for 24‑48 hours, giving security teams time to review. The malicious plain-crypto-js@4.2.1 would have been quarantined.
  • Automated IOCs enrichment: The Enterprise AI platform by UBOS correlates network logs with known C2 indicators, instantly alerting you to outbound calls like sfrclak.com.
  • Zero‑trust CI pipelines: Integrate the UBOS partner program SDK to enforce npm ci --ignore-scripts and deny any package that declares a post‑install hook without explicit approval.
  • Rapid remediation playbooks: Our UBOS pricing plans include pre‑built response templates that automate secret rotation, host rebuilding, and firewall rule deployment.

For startups looking for a lightweight entry point, see UBOS for startups. SMBs can leverage UBOS solutions for SMBs to get enterprise‑grade supply‑chain security without a large security team.

Boost Your Defense with UBOS Templates

UBOS’s template marketplace provides ready‑made AI‑powered tools that can be deployed in minutes. A few that directly help with supply‑chain visibility:

Take Action Today

If your organization relies on npm packages, you cannot afford to wait for the next supply‑chain breach. Secure your pipelines, rotate secrets, and adopt a proactive monitoring platform.

Start a free trial of UBOS’s AI marketing agents to automate security communications, or explore the Web app editor on UBOS to build custom dashboards that surface IOCs in real time.

Visit the UBOS contact page to speak with a security specialist and get a tailored roadmap for protecting your supply chain.

© 2026 UBOS. All rights reserved.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.