Skip to main content
Mallory
Malware

bun

Tracked since Mar 19, 2026 · Updated 8 months ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
Vulns0Associated
Actors0Associated
ATT&CK40Techniques
IOCs0Tracked
Is this in your environment?See whether this family's indicators match your telemetry and which of your assets are exposed to the CVEs associated with it.
Check your exposure
MITRE ATT&CK

Techniques & procedures

40 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

2 techniques
T1195Supply Chain CompromiseEvidence3

StepSecurity reported a new coordinated npm supply chain attack targeting SAP development ecosystem packages. The attackers compromised multiple packages including mbt and @cap-js/sqlite.

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

12 techniques
T1059Command and Scripting InterpreterEvidence21

Downloads the Bun JavaScript runtime v1.3.13 directly from its official GitHub release page. Launches the second-stage payload via Bun.

T1059.001PowerShellEvidence1

The implementation also follows HTTP redirects without validating the destination and uses PowerShell with -ExecutionPolicy Bypass on Windows, increasing the risk for affected developer and CI/CD environments.

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.007JavaScriptEvidence43

Bun executed attacker-supplied JavaScript modules.

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

T1129Shared ModulesEvidence1

That '.bun' section is the actor’s payload container. This holds malicious JavaScriptCore bytecode for 'app.js'. When the assembled file runs, the Bun interpreter engine executes that embedded bytecode.

T1204User ExecutionEvidence2

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

T1204.002Malicious FileEvidence1

Socket’s analysis revealed a hidden _runtime directory embedded inside the malicious packages containing a multi-stage execution chain that activates automatically when the module is imported, requiring no additional user interaction.

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.

T1574.001DLLEvidence1

In the SAP wave, the compromised packages added a preinstall hook that ran setup.mjs... This wave uses a slightly different route... That Git dependency contains a prepare script: "scripts" : { "prepare" : "bun run tanstack_runner.js && exit 1" } This is the trick. npm runs lifecycle scripts for Git dependencies during installation.

T1574.006Dynamic Linker HijackingEvidence1

MITRE ATT&CK Mapping Technique Description Campaign Application T1574.006 Hijack Execution Flow Bun runtime dynamically fetched from GitHub

T1574.007Path Interception by PATH Environment VariableEvidence2

The poisoned versions ship a preinstall hook: "scripts" : { "preinstall" : "node setup.mjs" }

Persistence

3 techniques
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.

T1543Create or Modify System ProcessEvidence1

Identify Background Processes: Check for long-running processes (using the Bun runtime) that weren’t started by the user.

T1546Event Triggered ExecutionEvidence1

In the SAP wave, the compromised packages added a preinstall hook that ran setup.mjs... This wave uses a slightly different route... That Git dependency contains a prepare script: "scripts" : { "prepare" : "bun run tanstack_runner.js && exit 1" } | The compromised package also adds an optional dependency that points to a GitHub-hosted package... That Git dependency contains a prepare script: "scripts" : { "prepare" : "bun run tanstack_runner.js && exit 1" } This is the trick. npm runs lifecycle scripts for Git dependencies during installation.

Privilege Escalation

4 techniques
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.

T1543Create or Modify System ProcessEvidence1

Identify Background Processes: Check for long-running processes (using the Bun runtime) that weren’t started by the user.

T1546Event Triggered ExecutionEvidence1

In the SAP wave, the compromised packages added a preinstall hook that ran setup.mjs... This wave uses a slightly different route... That Git dependency contains a prepare script: "scripts" : { "prepare" : "bun run tanstack_runner.js && exit 1" } | The compromised package also adds an optional dependency that points to a GitHub-hosted package... That Git dependency contains a prepare script: "scripts" : { "prepare" : "bun run tanstack_runner.js && exit 1" } This is the trick. npm runs lifecycle scripts for Git dependencies during installation.

T1548.003Sudo and Sudo CachingEvidence1

From there, it pulls the GitHub authentication token and escalates privileges via sudo python3 before sending the collected credentials over an outbound HTTPS connection on port 443 to the attacker’s domain, t.m-kosche.com.

Stealth

11 techniques
T1027Obfuscated Files or InformationEvidence4

The malicious packages use preinstall hooks to download the Bun JavaScript runtime and execute an obfuscated payload.

T1036MasqueradingEvidence1

The activity used update-themed staging and a renamed Bun executable.

T1070Indicator RemovalEvidence1

The Bun binary is self-deleted after execution to reduce forensic traces.

T1070.004File DeletionEvidence3

At install time, the packages fetch a signed Bun runtime release from GitHub, execute an obfuscated JavaScript stealer under it, and delete the runtime.

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.

T1497.001System ChecksEvidence3

setup.mjs performs OS and architecture detection, then downloads Bun 1.3.13 from GitHub releases to execute the main payload.

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.

T1574.001DLLEvidence1

In the SAP wave, the compromised packages added a preinstall hook that ran setup.mjs... This wave uses a slightly different route... That Git dependency contains a prepare script: "scripts" : { "prepare" : "bun run tanstack_runner.js && exit 1" } This is the trick. npm runs lifecycle scripts for Git dependencies during installation.

T1574.006Dynamic Linker HijackingEvidence1

MITRE ATT&CK Mapping Technique Description Campaign Application T1574.006 Hijack Execution Flow Bun runtime dynamically fetched from GitHub

T1574.007Path Interception by PATH Environment VariableEvidence2

The poisoned versions ship a preinstall hook: "scripts" : { "preinstall" : "node setup.mjs" }

T1620Reflective Code LoadingEvidence1

Instead, it delivers assembly instructions to the victim’s browser, retrieves a clean legitimate file from separate infrastructure, and directs the browser to build the final malware in memory on the victim’s machine.

Defense Impairment

1 technique
T1685Disable or Modify ToolsEvidence1

By running the payload outside of the standard node process, the attacker bypasses security tools and endpoint detection and response (EDRs) that specifically monitor Node.js child-process behavior.

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 FilesEvidence2

The staged Bun code ran gh auth token. It ran git credential-manager github list --no-ui.

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.

Discovery

5 techniques
T1057Process DiscoveryEvidence2

It checked for ssh and scp, enumerated running processes, and invoked a shell with a temporary updater.py path.

T1082System Information DiscoveryEvidence1

Platform detection — resolves a Bun binary name from a {platform}-{arch} matrix covering Linux, macOS, and Windows ARM and x64.

T1497.001System ChecksEvidence3

setup.mjs performs OS and architecture detection, then downloads Bun 1.3.13 from GitHub releases to execute the main payload.

T1518Software DiscoveryEvidence1

Before downloading anything, it checks its cache for an existing TruffleHog binary; if none is found, it fetches the latest release info from GitHub, downloads the correct binary for the system, extracts it, and makes it executable.

T1526Cloud Service DiscoveryEvidence1

...used the Bun JavaScript runtime, together with Microsoft Graph API, to enumerate users, SharePoint sites and mailboxes...

Collection

2 techniques
T1213Data from Information RepositoriesEvidence1

...used the Bun JavaScript runtime, together with Microsoft Graph API, to enumerate users, SharePoint sites and mailboxes before exfiltrating approximately 8.7 million files from 72 SharePoint subsites in about three days.

T1560Archive Collected DataEvidence1

The compromised releases added a preinstall script that acts as a runtime bootstrapper, downloading a platform-specific Bun ZIP from GitHub Releases, extracting it, and immediately executing the extracted Bun binary.

Command and Control

3 techniques
T1071.001Web ProtocolsEvidence1

All caused curl to contact GitHub and release-assets.githubusercontent.com during installation ... The payload spawned curl and downloaded Bun from GitHub release infrastructure.

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 TransferEvidence74

The dropper will detect the platform/architecture of the machine and download bun v1.3.13 directly from the official release page. It will extract bun, then use it to execute the payload.

Exfiltration

1 technique
T1041Exfiltration Over C2 ChannelEvidence1

...before sending the collected credentials over an outbound HTTPS connection on port 443 to the attacker’s domain, t.m-kosche.com.

Activity feed

Recent activity

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

View more in app →
+1 more in the timeline. Sign up to see them
Is this in your environment?See whether this family's indicators match your telemetry and which of your assets are exposed to the CVEs associated with it.
Check your exposure
Mallory platform

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 matchingMatch every observed IP, domain, and hash against your live telemetry.
Associated threat actorsGroups linked to this family, with evidence pinned to each claim.
Associated vulnerabilitiesCVEs linked to this family, with the reporting behind each link.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
MITRE ATT&CK mapping40Every documented technique, ranked by evidence weight.
Researcher chatterReddit, Mastodon, and CTI community discussion around this family.