bun
Hunt this family in your stack
Mallory pivots from this family to the IOCs, detections, and named campaigns that touch your stack, and pages you when something new lands.
Techniques & procedures
16 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
Initial Access
1 technique
Initial Access
The worm propagation logic mirrors Bitwarden attack with the same sequence: read npm tokens from .npmrc and the environment, validate each token, enumerate all packages the token can publish, inject the dropper into each package's preinstall hook, and republish as package-updated.tgz using Bun's native publish API.
Execution
6 techniques
Execution
The preinstall hook runs setup.mjs on every npm install mbt.
Step 1 — init.py spawns a background subprocess on import... subprocess.Popen([sys.executable, _start], cwd=_runtime_dir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
download the Bun JavaScript runtime, and run an obfuscated JavaScript payload named _index.js.
Native extension import trigger — Malicious code is embedded directly inside compiled .abi3.so extensions. The Python source appears clean, but the extension executes _index.js the moment Python loads the module via dlopen()
Persistence
1 technique
Persistence
Privilege Escalation
1 technique
Privilege Escalation
Stealth
3 techniques
Stealth
The 4.29 MB index.js dropper uses layered obfuscation, beginning with a large character-code array reconstructed at runtime, decoded through a ROT-XX (Caesar cipher) transformation, and dynamically executed via eval().
Credential Access
3 techniques
Credential Access
Specifically, the program targets cloud infrastructure tokens across multiple developer environments. The payload queries the local Amazon Web Services metadata endpoints to steal container roles.
Recent activity
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
The Bun JavaScript runtime is used by the malicious loader to execute the staged Shai-Hulud payload, downloading Bun from GitHub releases if it is not already present on the victim system.
A legitimate JavaScript runtime abused by Shai-Hulud to execute later-stage payloads in the JavaScript/npm infection path.
A legitimate JavaScript runtime abused by the malware as an execution and evasion component; the payload installs Bun and uses it to run malicious scripts and decrypt secondary payloads.
Used by the malicious package as an evasion-oriented execution runtime to launch the Shai-Hulud payload during npm package installation. The loader downloads Bun v1.3.13, executes the payload, and removes artifacts to reduce forensic visibility.
The version that knows your environment.
Match every observed IP, domain, and hash against your live telemetry.
Named campaigns wielding this family, with evidence pinned to each claim.
CVEs this family uses for access and lateral movement.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Every documented technique, ranked by evidence weight.
Reddit, Mastodon, and CTI community discussion around this family.