Unit 42 Report: Shai-Hulud Worm's Evolution Leads to Advanced npm Supply Chain Attacks Targeting Red Hat and TanStack

npm Ecosystem Under Siege as Shai-Hulud Successors Weaponize CI/CD Pipelines

CRITICAL
June 3, 2026
June 14, 2026
23m read
Supply Chain AttackMalwareThreat Actor

Impact Scope

People Affected

520 million+ cumulative downloads (for TanStack incident)

Industries Affected

TechnologyCritical InfrastructureFinanceHealthcareGovernment

Related Entities(initial)

Threat Actors

Products & Tech

Full Report(when first published)

Executive Summary

This report analyzes a severe escalation in the npm supply chain threat landscape, detailed in research by Unit 42. Since the emergence of the Shai-Hulud worm in September 2025, threat actors have shifted from nuisance-level attacks to systematic, high-impact campaigns. Adversaries, including the prolific TeamPCP group, are now deploying next-generation wormable malware such as Mini Shai-Hulud and Miasma. These attacks compromise developer accounts and abuse CI/CD pipelines—notably on GitHub—to distribute trojanized packages. Recent targets include widely-used libraries from Red Hat and TanStack, demonstrating the ability to bypass conventional security controls like code review and even subvert SLSA provenance checks. The primary goals are credential harvesting from developer environments and further propagation, creating a self-sustaining cycle of compromise that threatens the entire software development ecosystem.


Threat Overview

The npm ecosystem has transitioned into a high-consequence battleground for supply chain attacks. The original Shai-Hulud worm set the precedent, but recent campaigns show a marked increase in sophistication and automation.

Key Incidents:

  1. Red Hat Cloud Services Compromise (June 1, 2026): An attacker used a compromised Red Hat employee's GitHub account to inject the Miasma payload into 32 packages under the @redhat-cloud-services namespace. The attacker bypassed code review by pushing orphan commits and abused GitHub Actions to generate validly signed, yet malicious, packages using OpenID Connect (OIDC) tokens. These packages averaged 80,000 weekly downloads.

  2. TanStack CI/CD Pipeline Attack (May 11, 2026): TeamPCP executed a credential-free attack by chaining three GitHub Actions weaknesses. They compromised the CI pipeline for TanStack, a popular developer tooling provider, publishing 84 malicious artifacts across 42 @tanstack/* packages within minutes. The worm's self-propagation mechanism quickly spread to 169 distinct npm packages, impacting an estimated 520 million cumulative downloads.

  3. Ongoing Mini Shai-Hulud Waves: Throughout April and May 2026, multiple campaigns attributed to TeamPCP deployed variants of the Mini Shai-Hulud worm. These attacks included impersonating legitimate packages like @bitwarden/cli to steal credentials and backdoor developer projects for further propagation.

The core attack vector has shifted from simple typosquatting to the direct compromise of developer accounts and the CI/CD infrastructure they trust. By injecting malware during the automated build and publish process, attackers gain implicit trust and achieve massive distribution.


Technical Analysis

Adversaries are employing a multi-stage approach that combines social engineering, credential abuse, and CI/CD exploitation. The Miasma payload, derived from the open-sourced Mini Shai-Hulud, serves as a prime example.

Attack Chain Breakdown:

  1. Initial Access: Achieved through compromised developer credentials (T1078 - Valid Accounts) or by exploiting misconfigurations in CI/CD environments, as seen in the credential-free TanStack attack.
  2. CI/CD Abuse: Attackers trigger CI workflows (e.g., GitHub Actions) to gain temporary, but powerful, permissions. In the Red Hat attack, this involved requesting OIDC tokens (T1134 - Access Token Manipulation) to publish packages to the npm registry.
  3. Code Injection: Malicious code is injected into the project's source files before the build step. The Miasma payload was a heavily obfuscated index.js file, increasing its size by 25x—a potential detection indicator.
  4. Malicious Package Publication: The compromised CI/CD pipeline builds and publishes the trojanized package (T1195.002 - Compromise Software Supply Chain). The package appears legitimate, often with valid digital signatures or SLSA provenance, as the trusted pipeline itself was used for publication.
  5. Execution and Payload Delivery: When a developer installs the malicious package via npm install, the malicious scripts execute (T1059.007 - JavaScript/JScript). The payload then activates, initiating credential theft and propagation.
  6. Credential Theft: The malware scours the victim's machine and environment variables for sensitive credentials, including API keys for AWS, Google Cloud, Azure, and tokens for npm and GitHub (T1555 - Credentials from Password Stores).
  7. Propagation: The worm uses stolen npm tokens to backdoor every package the compromised developer has publish rights to, repeating the cycle.

The public release of the Mini Shai-Hulud source code by TeamPCP on May 12, 2026, has significantly lowered the barrier to entry for other actors, making attribution difficult and foreshadowing a rise in copycat attacks.


Impact Assessment

The business impact of these attacks is severe and multi-faceted, extending far beyond the initial victims.

  • Erosion of Trust: These attacks undermine the trust-based model of open-source software. When even packages from reputable publishers like Red Hat, signed with valid provenance, can be trojanized, it creates uncertainty for all developers.
  • Massive Downstream Risk: The compromise of a single popular package can lead to a cascading failure across thousands of organizations. The TanStack incident, affecting an estimated 520 million downloads, highlights the potential for widespread secondary breaches.
  • Credential Compromise: The primary goal of stealing credentials from developer machines and CI/CD environments provides attackers with keys to the kingdom, enabling lateral movement, data exfiltration, and further, more damaging attacks against the victim organization.
  • Remediation Costs: Organizations must expend significant resources to identify all instances of the malicious packages, revoke compromised credentials, audit their codebases, and restore trust in their build pipelines.
  • Brand and Reputational Damage: For publishers like Red Hat and TanStack, these incidents cause significant reputational harm, even if they were themselves victims of a sophisticated attack.

IOCs — Directly from Articles

The source article focuses on TTPs rather than traditional IOCs. However, the following contextual indicators were mentioned:

Type
File Name
Value
@bitwarden/cli
Description
Malicious package impersonating the legitimate Bitwarden CLI.
Type
Other
Value
2026.4.0
Description
Malicious version of the @bitwarden/cli package.
Type
Other
Value
@redhat-cloud-services
Description
The npm namespace under which 32 malicious packages were published.
Type
String Pattern
Value
Shai-Hulud: The Third Coming
Description
A string found within public GitHub repositories as part of a campaign.
Type
String Pattern
Value
Miasma: The Spreading Blight
Description
Description used by the attacker in newly created GitHub repositories.

Cyber Observables — Hunting Hints

Security teams may want to hunt for the following patterns, which could indicate related activity:

Type
File Name
Value
index.js
Description
Unusually large or heavily obfuscated index.js files in node_modules directories.
Context
File Integrity Monitoring, Static Analysis
Confidence
high
Type
Command Line Pattern
Value
npm install
Description
Monitor for npm install processes that spawn unexpected child processes (e.g., curl, bash, powershell).
Context
EDR, Process Auditing (Event ID 4688)
Confidence
high
Type
Log Source
Value
GitHub Actions logs
Description
Audit logs for OIDC token requests from forked repositories or unexpected workflows.
Context
GitHub Enterprise Audit Logs
Confidence
high
Type
Network Traffic Pattern
Value
build-server -> external-storage
Description
Anomalous network connections from CI/CD runners or build servers to unknown external IPs or cloud storage providers.
Context
Netflow, Firewall Logs
Confidence
medium
Type
File Path
Value
~/.npmrc
Description
Monitor for unauthorized read/access attempts to the npm configuration file, which stores authentication tokens.
Context
EDR, File Auditing
Confidence
high
Type
Registry Key
Value
HKCU\Software\npm
Description
On Windows, monitor for suspicious modifications to npm-related registry keys.
Context
EDR, Registry Monitoring
Confidence
medium

Detection & Response

Detecting these attacks requires a defense-in-depth approach focused on the software development lifecycle.

  • Dependency Scanning: Implement automated dependency analysis tools (e.g., Snyk, Dependabot, GitHub Advanced Security) to scan for known malicious packages. However, this is insufficient for zero-day attacks.
  • Behavioral Analysis: Use sandboxed environments to run npm install and observe the behavior of pre/post-install scripts. A D3FEND technique like Dynamic Analysis (D3-DA) can identify scripts that attempt to access the network or read sensitive files.
  • CI/CD Log Monitoring: Actively monitor CI/CD logs for anomalies. Create SIEM alerts for:
    • Builds initiated by suspicious users or from forked repositories.
    • Sudden spikes in package publications.
    • GitHub Actions workflows requesting OIDC tokens outside of expected patterns.
  • Endpoint Detection (EDR): On developer workstations, EDR solutions can detect npm or node processes making suspicious system calls, accessing files like ~/.ssh/ or ~/.aws/credentials, or spawning shells. This aligns with D3FEND's Process Analysis (D3-PA).
  • File Integrity Monitoring: Use File Analysis (D3-FA) to monitor for significant, unexpected changes in package file sizes within your node_modules directory, such as a 25x increase in an index.js file.

Mitigation

Organizations must harden their software development and dependency management practices.

  • Enforce MFA on Registries: Mandate multi-factor authentication for all developer accounts on package registries like npm and code hosting platforms like GitHub.
  • Harden CI/CD Pipelines:
    1. Implement strict branch protection rules and require multiple reviewers for all code changes, especially to CI/CD configuration files. This is a form of Application Configuration Hardening (D3-ACH).
    2. Use GitHub Actions features like environment protection rules to control which workflows can access secrets or publish artifacts.
    3. Tightly scope the permissions of CI/CD tokens to the minimum required for their task.
  • Dependency Management:
    1. Pin dependencies to specific, vetted versions using a lockfile (package-lock.json).
    2. Use a private or scoped npm registry to host vetted internal and third-party packages, reducing exposure to the public registry.
    3. Implement a quarantine process where new package versions are analyzed in a sandbox before being approved for use.
  • Developer Training: Educate developers on the risks of supply chain attacks, credential phishing, and the importance of securing their accounts and workstations. This maps to MITRE's User Training (M1017).

Timeline of Events

1
September 1, 2025
The Shai-Hulud worm emerges, marking a shift to high-consequence npm attacks.
2
April 22, 2026
A new campaign begins, including the string 'Shai-Hulud: The Third Coming'.
3
April 29, 2026
The 'Mini Shai-Hulud' campaign is initiated.
4
May 10, 2026
An attacker creates a malicious fork of the TanStack/router repository.
5
May 11, 2026
TeamPCP launches a coordinated supply chain attack on npm and PyPI via TanStack's CI pipeline.
6
May 12, 2026
TeamPCP open-sources the Mini Shai-Hulud malware, enabling copycat attacks.
7
June 1, 2026
A supply chain attack compromises at least 32 packages in the @redhat-cloud-services npm namespace using the Miasma payload.
8
June 3, 2026
This article was published

Article Updates

June 14, 2026

GitHub announces NPM v12 will disable automatic script execution by default, directly countering supply chain attacks like Shai-Hulud and TeamPCP.

MITRE ATT&CK Mitigations

Strictly manage and monitor permissions for developer accounts and CI/CD service principals to limit the blast radius of a compromise.

Harden the configuration of CI/CD platforms like GitHub Actions by enforcing branch protection, requiring reviewers, and limiting workflow triggers.

Mapped D3FEND Techniques:

Audit

M1047enterprise

Implement comprehensive logging and auditing for dependency management systems and CI/CD pipelines to detect anomalous behavior.

Mapped D3FEND Techniques:

Run build processes, especially dependency installation, in isolated, ephemeral environments to prevent access to sensitive network resources or files.

Mapped D3FEND Techniques:

Enforce MFA on all developer accounts for code repositories and package registries to prevent simple credential compromise.

Mapped D3FEND Techniques:

While the attack involves malicious updates, maintaining a rigorous process for vetting and applying legitimate updates (patches) to tooling and dependencies is crucial.

Mapped D3FEND Techniques:

D3FEND Defensive Countermeasures

In the context of the npm supply chain attacks, Application Configuration Hardening should be applied directly to the CI/CD platform, such as GitHub Actions. First, enforce strict branch protection rules on all production branches, requiring pull requests with at least one or two mandatory reviewers before merging. This directly counters the technique used in the Red Hat attack where an attacker pushed malicious commits directly. Second, leverage environment protection rules in GitHub Actions. Create a 'production' or 'publish' environment and configure it to require manual approval before a workflow can access secrets (like an NPM_TOKEN) or deploy. This adds a human verification step, preventing an automated worm from publishing malicious packages. Finally, harden the workflow trigger definitions. Disable pull_request_target triggers on public repositories unless absolutely necessary and fully understood, as they can be insecure. Instead, use triggers like workflow_dispatch for manual runs or pull_request on forks, which run with read-only tokens by default. These configurations create critical gates that disrupt the automated attack chain used by malware like Miasma.

To counter threats like Mini Shai-Hulud that execute during package installation, organizations should implement dynamic analysis by running npm install within a sandboxed environment before allowing new or updated dependencies into their main development workflow. This can be automated as part of a 'dependency quarantine' process. The sandbox should be an ephemeral, network-restricted container with extensive monitoring. During the analysis, security teams should monitor for specific malicious behaviors: 1) Network callouts to unknown domains, which could indicate C2 communication or credential exfiltration. 2) Filesystem access outside the project directory, especially attempts to read ~/.ssh/, ~/.aws/credentials, or ~/.npmrc. 3) Spawning of unexpected child processes, such as shells (sh, bash), curl, or powershell. Any dependency that exhibits these behaviors during the sandboxed installation should be immediately flagged, blocked, and investigated. This proactive analysis acts as a crucial defense layer, catching malicious pre/post-install scripts before they can execute on a developer's machine or in a production build pipeline.

Given that these attacks leverage compromised developer accounts, Domain Account Monitoring should be extended to federated identities on platforms like GitHub and npm. Security teams must ingest audit logs from these platforms into their SIEM. Create high-fidelity alerts for suspicious account activity, such as: 1) Logins from new or geographically anomalous locations. 2) A sudden, high-volume of commits or package publications from a single account, as seen with the TanStack compromise where 84 artifacts were published in minutes. 3) The creation of forked repositories with deliberately misleading names (e.g., zblgg/configuration from the report). 4) Commits authored by a spoofed user identity that does not match the committer's account. Establishing a baseline of normal developer activity is key. By monitoring for deviations, security teams can quickly detect a compromised developer account and disable it, containing the threat before it can be used to inject malicious code into a trusted supply chain.

Timeline of Events

1
September 1, 2025

The Shai-Hulud worm emerges, marking a shift to high-consequence npm attacks.

2
April 22, 2026

A new campaign begins, including the string 'Shai-Hulud: The Third Coming'.

3
April 29, 2026

The 'Mini Shai-Hulud' campaign is initiated.

4
May 10, 2026

An attacker creates a malicious fork of the TanStack/router repository.

5
May 11, 2026

TeamPCP launches a coordinated supply chain attack on npm and PyPI via TanStack's CI pipeline.

6
May 12, 2026

TeamPCP open-sources the Mini Shai-Hulud malware, enabling copycat attacks.

7
June 1, 2026

A supply chain attack compromises at least 32 packages in the @redhat-cloud-services npm namespace using the Miasma payload.

Sources & References(when first published)

The npm Threat Landscape: Attack Surface and Mitigations (Updated June 2)
Unit 42 (unit42.paloaltonetworks.com) June 2, 2026

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Tags

npmsupply chain attackCI/CDwormmalwarecredential theftopen source securityGitHub ActionsTeamPCPMiasmaShai-Hulud

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.