This hunt hypothesis targets adversaries who inject obfuscated JavaScript into compromised NPM packages to execute stealthy cryptocurrency wallet theft within the software supply chain. Proactively hunting for this behavior in Azure Sentinel is essential to identify and neutralize these sophisticated crypto-stealing attacks before they compromise developer environments and exfiltrate sensitive digital assets.
rule MAL_JS_NPM_SupplyChain_Attack_Sep25 {
meta:
description = "Detects obfuscated JavaScript in NPM packages used in supply chain crypto stealer attacks in September 2025"
author = "Florian Roth"
reference = "https://www.linkedin.com/feed/update/urn:li:activity:7370889385992437760/"
date = "2025-09-09"
modified = "2025-11-29"
score = 85
hash1 = "16f6c756bc8ce5ef5d9aa1ded0f811ec0c9cee3d8f85cc151b8ca1df7b8a4337"
id = "f083233e-348a-5b7d-a128-181c543a279c"
strings:
$x1 = "const _0x112fa8=_0x180f;(function(_0x13c8b9" ascii
$fp1 = "<html"
$fp2 = "<xml "
$fp3 = "<?xml"
condition:
filesize < 200KB
and 1 of ($x*)
and not 1 of ($fp*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 4 string patterns in its detection logic.
Here are 3-5 specific false positive scenarios for the rule “Detects obfuscated JavaScript in NPM packages used in supply chain crypto stealer attacks,” along with suggested filters and exclusions:
Scenario: Legitimate Minification of Frontend Bundles by Build Tools
app.min.js, vendor.bundle.js) to reduce file size. These build artifacts often contain high entropy strings and complex control flow that mimic the signature of malicious supply chain attacks.*.min.js or *.bundle.js located in standard artifact directories (dist/, build/).Scenario: Scheduled Maintenance Scripts Using Obfuscated Third-Party Libraries
chart.js, d3, lodash) when executed by specific service accounts (e.g., svc-finance-reporting) or during defined maintenance windows (e.g., 02:00–04:00 UTC).**Scenario: Deployment of Enterprise Single Sign-On (SS