Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
Malware

bun

Share:
For your environment

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.

MITRE ATT&CK

Techniques & procedures

16 distinct techniques documented for this family, organized by ATT&CK tactic.

Resource Development

1 technique
T1588Obtain CapabilitiesEvidence1

If not, it downloads the legitimate Bun runtime v1.3.13, and then executes the second-stage payload

Initial Access

1 technique
T1195.001Compromise Software Dependencies and Development ToolsEvidence1

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
T1059Command and Scripting InterpreterEvidence2

The preinstall hook runs setup.mjs on every npm install mbt.

T1059.006PythonEvidence1

Step 1 — init.py spawns a background subprocess on import... subprocess.Popen([sys.executable, _start], cwd=_runtime_dir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)

T1059.007JavaScriptEvidence13

download the Bun JavaScript runtime, and run an obfuscated JavaScript payload named _index.js.

T1106Native APIEvidence1

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()

T1204User ExecutionEvidence1

contains a hidden execution chain that silently downloads a JavaScript runtime (Bun) and executes an 11.4 MB heavily obfuscated JavaScript payload upon import lightning

T1574Hijack Execution FlowEvidence1

.pth startup-hook pattern — A malicious wheel bundles a *-setup.pth file alongside _index.js. The hook fires during Python startup, silently downloads the Bun JavaScript runtime, and executes the obfuscated stealer payload.

Persistence

1 technique
T1037Boot or Logon Initialization ScriptsEvidence1

The first branch is the .pth startup-hook pattern. A malicious wheel contains a *-setup.pth file and a bundled _index.js. The .pth hook runs during Python startup, downloads Bun if needed, and runs the JavaScript payload.

Privilege Escalation

1 technique
T1037Boot or Logon Initialization ScriptsEvidence1

The first branch is the .pth startup-hook pattern. A malicious wheel contains a *-setup.pth file and a bundled _index.js. The .pth hook runs during Python startup, downloads Bun if needed, and runs the JavaScript payload.

Stealth

3 techniques
T1027Obfuscated Files or InformationEvidence2

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().

T1140Deobfuscate/Decode Files or InformationEvidence1

Staged unpacking: The payload is unpacked through multiple decoding layers, including several ROT (rotate)-based obfuscation variants followed by AES-128-GCM decryption.

T1574Hijack Execution FlowEvidence1

.pth startup-hook pattern — A malicious wheel bundles a *-setup.pth file alongside _index.js. The hook fires during Python startup, silently downloads the Bun JavaScript runtime, and executes the obfuscated stealer payload.

Credential Access

3 techniques
T1528Steal Application Access TokenEvidence1

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.

T1552.001Credentials In FilesEvidence1

It searches for authorization keys inside the host environment variables. Furthermore, the binary attempts to steal npm publish tokens to widen the npm supply chain attack.

T1555Credentials from Password StoresEvidence1

Additionally, it extracts sensitive configuration secrets across 16 distinct AWS regions. In addition, the malware targets secrets stored inside HashiCorp Vault environments.

Command and Control

2 techniques
T1090.002External ProxyEvidence1

The loader retrieves a legitimate Bun bundle directly from GitHub to execute a pre-bundled file hidden inside the tarball.

T1105Ingress Tool TransferEvidence21

The bootstrapper... fetches https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/ .zip from GitHub's official release CDN.

ACTIVITY FEED

Recent activity

5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets match these IOCs, which detections are missing, which campaigns to expect next, and what to do in the next 30 minutes.
IOC matching

Match every observed IP, domain, and hash against your live telemetry.

Threat actor attribution

Named campaigns wielding this family, with evidence pinned to each claim.

Exploited vulnerabilities

CVEs this family uses for access and lateral movement.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

MITRE ATT&CK mapping16

Every documented technique, ranked by evidence weight.

Researcher chatter

Reddit, Mastodon, and CTI community discussion around this family.