Skip to main content
Back
IntrusionAWS · Google Cloud · Azure · SaaS
8 min read

Shai-Hulud 2.0 npm worm stealing secrets from developer and CI hosts

Victim
npm maintainers and the developer machines and CI runners that installed the trojanized packages; PostHog, Trigger.dev and Elastic published their own accounts
When
Nov 24, 2025 per Aikido and Wiz; Wiz's text says Nov 21–23Disclosed Nov 24, 2025
Entry
Trojanized npm packages, published with maintainer credentials, whose preinstall script stole secrets from the developer or CI machine and republished more packages; the route to the first maintainer credentials is documented only for PostHog, through a CI workflow.

From November 24, 2025, trojanized versions of hundreds of npm packages ran a preinstall script that installed Bun and executed an obfuscated payload on each host that installed them. The payload collected GitHub and npm tokens and cloud credentials, published them to public GitHub repositories, and republished up to 100 of the victim's own packages. From November 26, Wiz saw leaked AWS long-term keys and GitHub tokens abused; no source reports a wiper running.

What happened

External Parties
GitHub
npm
Aikido and Wiz
+ 1 more
Internet
Cloud APIstolen keys and sessions
npm Registry and Maintainers
Developer Machines and CI Runners
+ Secrets Manager
+ Key Vault
+ IAM roles
Cloud Accounts
+ exfiltration repositories
+ organization repositories
+ Actions secrets
GitHub Accounts and Repositories
Maintainer CI Workflow
Trojanized npm Packages
Developer Machine or CI Runner
Local Tokens and Cloud Keys

Replaying the Shai-Hulud 2.0 November 2025 intrusion

  1. 1

    Maintainer publishes

    Nov 18–24, 2025

    A pull request makes a CI workflow hand over a bot token; the bot token then rewrites a workflow that hands over an npm publishing token, and trojanized versions are published with maintainer credentials.

  2. 2

    Install-time theft

    From Nov 24, 2025

    On install, the preinstall script runs on a developer machine or CI runner, collects tokens and cloud credentials and attempts to dump cloud secrets managers.

  3. 3

    Exfiltration and spread

    From Nov 24, 2025

    The stolen data goes to public GitHub repositories, and the worm republishes up to 100 of the victim's own packages with the npm token it finds.

  4. 4

    Stolen keys in use

    Nov 25–26, 2025

    Leaked AWS long-term keys and GitHub tokens are used, and one victim's GitHub organization is cloned and force-pushed.

Impact

Hundreds of npm packages were trojanized (492 per Aikido, about 700 to nearly 800 per Wiz, over 800 per Kaspersky), and stolen secrets went to over 25,000 public GitHub repositories; Wiz's sample held about 775 GitHub tokens and 373 AWS, 300 GCP and 115 Azure credentials, and from Nov 26, 2025 Wiz saw leaked AWS long-term keys and GitHub tokens abused. One victim had 199 branches force-pushed and restored within about 7 hours. No source reports a cloud account taken over or a wiper running.

Outcome

Where cloud-provider controls fit

The worm needed no cloud weakness: it ran as the installing user and read what that user could read. Cloud controls could remove long-lived keys from the host and bound what a stolen session reached, but the publish, the install script and the GitHub tokens belong to npm and GitHub. You can close or cap those steps with their own settings. Wiz saw stolen keys used from November 26, and no source reports a cloud account taken over.

Could this have been prevented?

In hindsight, not as a whole. 3 controls would have refused a step outright, and 24 controls would have limited one. 8 steps have no cloud-provider control. The counts below are control assessments, not attack stages: several can address the same step. The same replay with the controls in place before the incident shows where each phase would have been refused or bounded.

3
Prevented
24
Contained
8
Not covered

How it could have been prevented

The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.

External Parties
GitHub
npm
Aikido and Wiz
+ 1 more
Internet
Cloud APIstolen keys and sessions
npm Registry and Maintainers
Developer Machines and CI Runners
+ Secrets Manager
+ Key Vault
+ IAM roles
Cloud Accounts
+ exfiltration repositories
+ organization repositories
+ Actions secrets
GitHub Accounts and Repositories
Maintainer CI Workflow
Trojanized npm Packages
Developer Machine or CI Runner
Local Tokens and Cloud Keys

Replaying the Shai-Hulud 2.0 November 2025 intrusion

1 · Maintainer publishes

5 Contained2 Not covered

2 · Install-time theft

1 Prevented12 Contained2 Not covered3 on other clouds

3 · Exfiltration and spread

1 Prevented2 Contained2 Not covered

4 · Stolen keys in use

1 Prevented5 Contained2 Not covered1 on other clouds

Key facts

  • Aikido detected the first compromised packages at 03:16:26 UTC on November 24, 2025 and counted 492 packages, with about 132 million monthly downloads
  • Package counts differed by source: 492 (Aikido), about 700 to nearly 800 (Wiz) and over 800 (Kaspersky); Wiz counted over 25,000 exfiltration repositories
  • PostHog's npm publishing token was taken through a pull_request_target workflow on November 23, 2025, and its malicious versions went live at 04:11 UTC on November 24
  • In a sample of about 20,000 repositories Wiz found 775 GitHub tokens and 373 AWS, 300 GCP and 115 Azure credentials, all approximate
  • In one victim's GitHub organization, 199 branches across 16 repositories were force-pushed in about 10 minutes on November 25, 2025 and restored within about 7 hours
  • From 16:00 UTC on November 26, 2025 Wiz saw leaked AWS long-term keys and GitHub tokens used; no count or account is given

Sources

Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.

  1. 1.
    Shai-Hulud 2.0 Supply Chain Attack: 25K+ Repos Exposing SecretsWiz Research · Nov 24, 2025 · Researchtimeline, malware behavior, exfiltration, cloud credential theft, sampled secrets, abuse of leaked keys, backdoor, counts, mitigations
  2. 2.
    Shai Hulud Launches Second Supply-Chain Attack: Zapier, ENS, AsyncAPI, PostHog, Postman CompromisedAikido Security · Nov 24, 2025 · Researchdetection timeline, package counts, named namespaces, staging script, exfiltration repository description
  3. 3.
    Post-mortem of Shai-Hulud attack on November 24th, 2025PostHog · Nov 26, 2025 · Vendor reportinitial access chain, timeline, affected packages, remediation
  4. 4.
    How we got hit by Shai-Hulud: A complete post-mortemTrigger.dev · Nov 25, 2025 · Vendor reportdeveloper machine infection, GitHub org activity, AWS access, containment, changes made
  5. 5.
    Navigating the Shai-Hulud Worm 2.0: Elastic's updated response to npm supply chain compromiseElastic · Dec 1, 2025 · Vendor reportCI pipeline incident, containment, mitigations, propagation scope
  6. 6.
    Shai Hulud 2.0, now with a wiper flavorKaspersky Securelist · Dec 3, 2025 · Researchinstall-time execution, npm token propagation, wiper trigger, cloud credential theft, telemetry counts

The estate in the replay is illustrative and drawn at the level of attack stages; the victim's real environment is not public. Verdicts describe what a control does when it is in place before the incident. They are not an assessment of the victim's security program.

More cloud attack breakdowns

All breakdowns