← Back to SOC feed Coverage →

Detects a supply chain compromise in NPM packages (TinyColor, CrowdStrike etc.)

yara CRITICAL signature-base
florian-rothjs_npm
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at signature-base →
Retrieved: 2026-08-06T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hunt hypothesis targets adversaries who inject malicious code into widely trusted NPM packages like TinyColor and CrowdStrike to execute supply chain attacks that can silently propagate across multiple environments. Proactively hunting for this behavior in Azure Sentinel is essential because compromised dependencies often bypass traditional perimeter defenses, allowing attackers to establish a foothold within the organization’s internal network before detection occurs.

YARA Rule

rule MAL_JS_NPM_SupplyChain_Compromise_Sep25 {
   meta:
      description = "Detects a supply chain compromise in NPM packages (TinyColor, CrowdStrike etc.)"
      author = "Florian Roth"
      reference = "https://socket.dev/blog/tinycolor-supply-chain-attack-affects-40-packages"
      date = "2025-09-16"
      modified = "2025-09-17"
      score = 80
      id = "f64fa37b-8445-554a-8442-bd2d42a6643b"
   strings:
      $x1 = "if (plat === \"linux\") return \"https://github.com/trufflesecurity/trufflehog/releases"

      $sa1 = "curl -d \"$CONTENTS\" https://webhook.site/" ascii
      $sa2 = "curl -s -X POST -d \"$CONTENTS\" \"https://webhook.site/"

      $sb1 = " | base64 -w 0 | " ascii
      $sb2 = " | base64 -w0)"
   condition:
      filesize < 20MB
      and (
         1 of ($x*)
         or (
            1 of ($sa*)
            and 1 of ($sb*)
         )
      )
      and not uint8(0) == 0x7b  // JSON {
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 5 string patterns in its detection logic.

References

False Positive Guidance

Here are 5 specific false positive scenarios for the “Supply Chain Compromise in NPM Packages” detection rule, including suggested filters or exclusions:

Original source: https://github.com/Neo23x0/signature-base/blob/main/yara/mal_npm_supply_chain_sep25.yar