Shai-Hulud Malicious Bun Execution

Detects the execution of bun_environment.js via the Bun runtime, a behavior associated with the Shai-Hulud "Second Coming" NPM supply chain attack. The malware uses a setup_bun.js script to install the Bun runtime if not present, and then executes the malicious bun_environment.js payload.

Sigma rule (View on GitHub)

 1title: Shai-Hulud Malicious Bun Execution
 2id: 5299fadf-f228-4526-8274-251db1960be9
 3related:
 4    - id: eb827bbd-670a-4d58-8446-c464d8ac2323
 5      type: similar
 6status: experimental
 7description: |
 8    Detects the execution of `bun_environment.js` via the Bun runtime, a behavior associated with the Shai-Hulud "Second Coming" NPM supply chain attack.
 9    The malware uses a `setup_bun.js` script to install the Bun runtime if not present, and then executes the malicious `bun_environment.js` payload.    
10references:
11    - https://www.aikido.dev/blog/shai-hulud-strikes-again-hitting-zapier-ensdomains
12    - https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack
13    - https://github.com/asyncapi/cli/blob/2efa4dff59bc3d3cecdf897ccf178f99b115d63d/setup_bun.js
14    - https://semgrep.dev/blog/2025/digging-for-secrets-sha1-hulud-the-second-coming-of-the-npm-worm/
15author: Swachchhanda Shrawan Poudel (Nextron Systems)
16date: 2025-11-25
17tags:
18    - attack.t1195.002
19    - attack.t1203
20    - attack.execution
21    - attack.initial-access
22    - detection.emerging-threats
23logsource:
24    category: process_creation
25    product: windows
26detection:
27    selection_parent:
28        ParentImage|endswith: '\node.exe'
29    selection_child_bun_script:
30        Image|endswith: '\bun.exe'
31        CommandLine|contains:
32            - 'bun_environment.js'
33            - 'https://github.com/actions/runner/releases/download/v2.330.0'
34    condition: selection_parent and 1 of selection_child_*
35falsepositives:
36    - Legitimate but uncommon use of files named `bun_environment.js` could trigger this rule.
37level: high
38regression_tests_path: regression_data/rules-emerging-threats/2025/Malware/Shai-Hulud/proc_creation_win_mal_shai_hulud_malicious_node_bun_execution/info.yml

References

Related rules

to-top