Shai-Hulud Malicious Bun Execution - Linux

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 - Linux
 2id: eb827bbd-670a-4d58-8446-c464d8ac2323
 3related:
 4    - id: 5299fadf-f228-4526-8274-251db1960be9
 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
14author: Swachchhanda Shrawan Poudel (Nextron Systems)
15date: 2025-11-25
16tags:
17    - attack.t1195.002
18    - attack.t1203
19    - attack.execution
20    - attack.initial-access
21    - detection.emerging-threats
22logsource:
23    category: process_creation
24    product: linux
25detection:
26    selection_parent:
27        ParentImage|endswith: '/node'
28    selection_child_bun:
29        Image|endswith: '/bun'
30        CommandLine|contains:
31            - 'bun_environment.js'
32            - 'https://github.com/actions/runner/releases/download/v2.330.0'
33    selection_child_setup_curl:
34        CommandLine|contains|all:
35            - 'curl '
36            - '-fsSL'
37            - 'https://bun.sh/install'
38            - 'bash'
39    selection_child_path_reload:
40        CommandLine|contains|all:
41            - 'bash -c "source '
42            - '&& echo'
43    condition: selection_parent and 1 of selection_child_*
44falsepositives:
45    - Legitimate but uncommon use of files named `bun_environment.js` could trigger this rule.
46level: high

References

Related rules

to-top