Skip to content

YARA · Signature Base (Florian Roth / Nextron)

SIGNATURE_BASE_MAL_JS_NPM_Supplychain_Compromise_Sep25

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

MalwareSignature Base (Florian Roth / Nextron)Detection Rule License 1.1Compiles with YARA-X
Author
Florian Roth
Date
2025-09-16
Modified
2025-09-17
Score / Quality
80 / 85

What this rule detects

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

It defines 5 patterns (5 text, 0 hex, 0 regex).

Summary generated from the rule's metadata and condition.

Rule source

mal-js-npm-supplychain-compromise-sep25.yarDetection Rule License 1.1
rule SIGNATURE_BASE_MAL_JS_NPM_Supplychain_Compromise_Sep25 : FILE
{
	meta:
		description = "Detects a supply chain compromise in NPM packages (TinyColor, CrowdStrike etc.)"
		author = "Florian Roth"
		id = "f64fa37b-8445-554a-8442-bd2d42a6643b"
		date = "2025-09-16"
		modified = "2025-09-17"
		reference = "https://socket.dev/blog/tinycolor-supply-chain-attack-affects-40-packages"
		source_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/yara/mal_npm_supply_chain_sep25.yar#L23-L50"
		license_url = "https://github.com/Neo23x0/signature-base/blob/94a1c48d7ab499879287ff611dfe7f9c56376030/LICENSE"
		logic_hash = "6ddcf152ee8b90496d9d3f7f51dc239d927a3a2095082d13c6cc7e21819097f4"
		score = 80
		quality = 85
		tags = "FILE"

	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
}

Strings (5 patterns)

IdentifierTypeValueModifiers
$x1text"if (plat === \"linux\") return \"https://github.com/trufflesecurity/trufflehog/releases"
$sa1text"curl -d \"$CONTENTS\" https://webhook.site/"ascii
$sa2text"curl -s -X POST -d \"$CONTENTS\" \"https://webhook.site/"
$sb1text" | base64 -w 0 | "ascii
$sb2text" | base64 -w0)"

Condition

filesize < 20MB and ( 1 of ( $x* ) or ( 1 of ( $sa* ) and 1 of ( $sb* ) ) ) and not uint8( 0 ) == 0x7b

In plain words (Heuristic)

  • The file must be smaller than 20MB (a cheap guard that skips large files).
  • At least 1 patterns in ( $x* ) must match.
  • At least 1 patterns in ( $sa* ) must match.
  • At least 1 patterns in ( $sb* ) must match.

Test this rule in your browser

Drop a file to scan it with this rule using YARA-X compiled to WebAssembly. Nothing is uploaded.

Drop a file here or click to chooseScanned locally with YARA-X. Files up to 200 MB.

Open in editor

References

Licence & attribution

Author: Florian Roth

Source repository: Signature Base (Florian Roth / Nextron) @ 94a1c48d7a

Licence: Detection Rule License 1.1 (repository licence)

Original rule

Mirrored via YARA Forge 20260927, which prefixes rule names with the source and adds normalised meta fields.

Rule id: f64fa37b-8445-554a-8442-bd2d42a6643b

Tags:FILE