Malicious Bun Runtime Payload Dropped by Shai Hulud npm Supply Chain Attack

PremiumReviewedSigma · High · v1
Category
file_event
Author
HuntRule
Published
2026-06-13
Updated
2026-08-28

ATT&CK techniques

Initial Access → Execution
  1. Recon

  2. Resource Dev

  3. Persistence

  4. Priv Esc

  5. Defense Evasion

  6. Cred Access

  7. Discovery

  8. Lateral Movement

  9. Collection

  10. C2

  11. Exfiltration

  12. Impact

What it detects

This rule detects creation of the setup_bun.js or bun_environment.js files associated with the Shai Hulud 2.0 npm supply-chain worm. A malicious preinstall script drops setup_bun.js which installs the Bun runtime and stages the large bun_environment.js payload for credential theft and self-propagation. These distinctive filenames written during package installation indicate the worm establishing execution.

Related detections9 linkedT1059.007 — drag to rearrange
Suspicious NPM Install Hook Executing Setup Script via Node
Malicious Shai-Hulud Bun Payload Execution via npm Preinstall Script (via process_creation)
Malicious Shai-Hulud npm Payload Execution via bun_environment Script (via process_creation)
Linux File Creation Indicators for TanStack Runner and Persistence Components
Windows TanStack Supply-Chain File Creation Indicators via router_init.js and router_runtime.js
Suspicious Node Payload Drop in Local Share Directory (via file_event)
Possible React2Shell CVE-2025-55182 Prototype Pollution Exploitation
Suspicious Node.js Script Execution from AppData Roaming
Possible Reflected XSS via cPanel cpanelwebcall Endpoint CVE-2023-29489
Malicious Bun Runtime Payload Dropped by Shai Hulud npm Supply Chain Attack
Pivot detection · T1059.007 · 9 related

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.