This detection identifies the execution of a malicious JavaScript worm named bun_environment.js, which adversaries likely deploy to establish persistence and propagate lateral movement within cloud workloads. SOC teams should proactively hunt for this artifact in Azure Sentinel because its critical severity indicates a high risk of rapid infection across interconnected resources, necessitating immediate containment before the worm compromises sensitive data or disrupts service availability.
rule MAL_JS_NPM_SupplyChain_Attack_Nov25 {
meta:
description = "Detects malicious JavaScript worm bun_environment.js"
author = "Marius Benthin"
date = "2025-11-24"
modified = "2025-12-15"
reference = "https://www.aikido.dev/blog/shai-hulud-strikes-again-hitting-zapier-ensdomains"
hash = "62ee164b9b306250c1172583f138c9614139264f889fa99614903c12755468d0"
score = 80
id = "11726cbe-48a7-577a-9694-8f38ffa746e1"
strings:
$sa1 = "npm publish"
$sa2 = "NPM_TOKEN"
$sa3 = "NPM_CONFIG_TOKEN"
$sb1 = "GITHUB_"
$sb2 = "GITLAB_"
$sb3 = "TEAMCITY_"
condition:
filesize < 20MB
and all of ($sa*)
and 2 of ($sb*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 6 string patterns in its detection logic.
Here are 5 specific false positive scenarios for the Detects malicious JavaScript worm bun_environment.js rule, including suggested filters and exclusions:
Scenario: Automated Build Pipeline Execution
bun_environment.js as part of the runtime configuration for containerized microservices. This file is created and executed during every nightly deployment window.node.exe, java.exe) and Parent Process (e.g., jenkins-agent.exe or azdagent). Additionally, exclude any execution occurring within the specific network segment of the build cluster (e.g., subnet 10.20.45.0/24).Scenario: Scheduled Maintenance Script for DevOps Tooling
bun_environment.js module from the internal artifact repository (e.g., Artifactory or Nexus). This is a standard administrative task for refreshing developer workstations.C:\ProgramData\DevOps\Scripts\bun_environment.js if the hash of this legitimate file is known.Scenario: Third-Party SaaS Integration Agent
bun_environment.js into web browsers to capture real-time