These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.
Shai-Hulud self-propagating npm worm
September 2025 / November 2025 / May 2026 · Contained
A self-spreading npm worm: each infected install stole the victim's GitHub and npm tokens, pushed a workflow that sent their repositories' secrets out, and published infected versions of the victim's own packages.
- Went after
- Steal CI secrets and tokensPoison the build or published packageRead or expose private codeKeep access
- Access held
- T0repoT1workflowT1Runner registration token or JIT configurationT3Contents: Readnpm publish tokennpm tokensCloud keys and secretsRepository Actions secrets
- Scale
- May 2026 wave: more than 630 malicious versions across 317 npm packages in about 20 minutes
Full summary
A worm that turned each victim into the publisher of the next round. Malicious versions of popular npm packages, published with stolen maintainer npm tokens, ran a payload at install time on developer machines and CI runners. It ran TruffleHog over the disk, read cloud keys from metadata services, took the GitHub token from the environment or the gh CLI and wrote everything it found to a new public repository in the victim's own GitHub account. With the same token it pushed a workflow to every repository the victim could reach that sent that repository's Actions secrets out, and copied private organization repositories into public ones. Any npm token it found was used to publish infected versions of that maintainer's other packages, and so the worm spread. The first wave started on 15 September 2025. Shai-Hulud 2.0, from 21 November 2025, ran before install, also registered the infected machine as a self-hosted runner named SHA1HULUD with a workflow that let anyone run commands on it by opening a discussion, and wiped the home directory when it found no token to spread with. Datadog counted 796 packages and more than 500 GitHub users across 150 organizations; Wiz found more than 25,000 exfiltration repositories. A smaller descendant, Mini Shai-Hulud, which Wiz attributes to TeamPCP, came back in 2026: on 19 May one stolen npm token published 637 malicious versions of 317 packages, including the AntV libraries, in under half an hour. Its TanStack wave a week earlier came in through Actions cache poisoning (see the cache poisoning incident).
How it unfolded
Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.
Whole path
The whole attack, one row per step. Pick a step on the left, or click a box in its row.
On 15 September 2025 malicious versions of more than 100 npm packages appeared, among them @ctrl/tinycolor 4.1.1 and 4.1.2, published with maintainers' own npm tokens. Wiz assesses the campaign is directly downstream of the s1ngularity compromise of Nx in late August, which leaked npm and GitHub tokens. Shai-Hulud 2.0 versions were published between 21 and 24 November 2025 with other stolen maintainer tokens, hitting Zapier, ENS Domains, PostHog, Postman and AsyncAPI packages. PostHog's postmortem, cited by Wiz, traced its own token to a pull_request_target workflow.
What breaks this step
- Adopt artifact attestations for build provenance on published binaries/images
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Publish packages with trusted publishing (OIDC) instead of long-lived registry tokens
- Put production secrets in environments with required reviewers
- Write and rehearse a credential-rotation runbook before you need it
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Secret scanning and push protection enabled
- Set `persist-credentials: false` on actions/checkout wherever later steps do not push
- Require organization owner approval for fine-grained PATs.
- Never upload the checkout workspace as an artifact.
In September a postinstall script ran the payload; 2.0 used a preinstall script that installed the Bun runtime and ran setup_bun.js and bun_environment.js. It downloaded TruffleHog and scanned the whole disk, read cloud keys from environment variables and the AWS, Azure and Google metadata services, and in 2.0 dumped cloud secret stores. It took the GitHub token from GITHUB_TOKEN or the gh CLI and checked that it had the repo and workflow scopes. The results went, double base64 encoded, into a new public repository in the victim's own account: named Shai-Hulud in September, an 18 character random name described as "Sha1-Hulud: The Second Coming." in November. Only 23% of 2.0 infections Wiz analysed were on developer machines; most were CI runners and containers.
What breaks this step
- Third-party Actions pinned to a full commit SHA instead of a mutable tag or branch
- Restrict which Actions can run to GitHub-verified creators or an internal allow-list
- Review new dependencies in PRs and hold new package versions for a few days before they're allowed in (a cooldown).
- Disable install scripts where you can (npm ignore-scripts).
The worm listed repositories through /user/repos with affiliation=owner,collaborator,organization_member, updated since 1 January 2025. In September it pushed .github/workflows/shai-hulud-workflow.yml on a new shai-hulud branch to each one; the workflow ran on push and sent ${{ toJSON(secrets) }} to a webhook.site URL, and the secrets also stayed in the run logs. In 2.0 it pushed formatter_<number>.yml on an add-linter-workflow branch, which wrote the secrets to an artifact, then downloaded the artifact and deleted the workflow and the branch. The workflow ran on its own branch, so branch protection on the default branch did not stop it.
What breaks this step
- CODEOWNERS in place, required on sensitive paths
- Rulesets applied: push restriction, tag protection, sensitive file-path protection
- Inventory every Actions secret and its visibility/scope; the results are usually surprising
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Put production secrets in environments with required reviewers
In September a second script cloned private and internal repositories of the victim's organizations and pushed each to a new repository in the victim's account named <repo>-migration with the description "Shai-Hulud Migration". It created the copy as private and then made it public. Wiz first saw 8 users affected. In 2.0, on 25 and 26 November, Wiz saw private repositories of one victim published with the description "Sha1-Hulud: The Continued Coming", and stolen tokens used to download private source.
What breaks this step
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Audit and revoke stale PATs, unused SSH keys, and inactive accounts
- Enforce an IP allow list for Git and web UI access from trusted ranges
- Service-account automation migrated from PATs to GitHub Apps
- Migrate to SAML SSO / Enterprise Managed Users for centralized identity control
- Restrict public repo creation, visibility changes, repo deletion, private forks and outside collaborator invites to owners
- Limit the number of organization owners to the minimum needed
- Enable audit logging and export it to a SIEM for retention and detection
When the payload found an npm token it checked it with npm's whoami endpoint, looked up the packages that maintainer owned, added the payload and an install script to each, bumped the patch version and published it. StepSecurity saw up to 20 packages per maintainer in September; Datadog saw up to 100 in 2.0. Without a GitHub token of its own, 2.0 searched GitHub for other victims' exfiltration repositories and took a token from their contents.json. Datadog counted 796 packages and 1,092 versions in 2.0, and more than 500 GitHub users across over 150 organizations.
What breaks this step
- Adopt artifact attestations for build provenance on published binaries/images
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Publish packages with trusted publishing (OIDC) instead of long-lived registry tokens
- Put production secrets in environments with required reviewers
- Write and rehearse a credential-rotation runbook before you need it
Shai-Hulud 2.0 downloaded the GitHub Actions runner into $HOME/.dev-env and registered it against the victim's repository under the name SHA1HULUD, then added a workflow, discussion.yaml, that runs on discussion events on that runner and puts the discussion body into a shell step. Opening a discussion would run commands on the infected machine. Wiz confirmed this in testing but had not seen it used. When the payload had neither a GitHub nor an npm token, it overwrote and deleted the user's home directory instead.
What breaks this step
- Disallow self-hosted runners on public repositories
- Enable audit logging and export it to a SIEM for retention and detection
- Review the self-hosted runners registered on each repository: 2.0 added the infected machine as one.
The descendant first appeared in SAP's npm packages at the end of April 2026, attributed by Wiz to TeamPCP, though Wiz could not tie it to the 2025 operators. On 19 May between 01:39 and 02:06 UTC, the npm token of the atool account, which maintains 547 packages, published 637 versions of 317 packages, including the @antv libraries, echarts-for-react and timeago.js. The Bun preinstall payload stole cloud, GitHub and npm credentials to Dune-themed public GitHub repositories, and in GitHub Actions exchanged OIDC tokens for npm publish tokens and added a "Run Copilot" workflow that saved the repository's secrets as an artifact. SafeDep does not say how the token was stolen.
What breaks this step
- Adopt artifact attestations for build provenance on published binaries/images
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Publish packages with trusted publishing (OIDC) instead of long-lived registry tokens
- Put production secrets in environments with required reviewers
- Write and rehearse a credential-rotation runbook before you need it
- Set an organization-wide maximum PAT lifetime (90 days is a reasonable default)
- Disable classic PATs organization-wide, forcing migration to fine-grained PATs
- Secret scanning and push protection enabled
- Set `persist-credentials: false` on actions/checkout wherever later steps do not push
- Require organization owner approval for fine-grained PATs.
- Never upload the checkout workspace as an artifact.
Frameworks
Part of
Contained. First seen September 2025, last seen May 2026. May 2026 wave: more than 630 malicious versions across 317 npm packages in about 20 minutes (as of 19 May 2026, source). Mapping by ghtier, not yet reviewed. Threat landscape
Sources
- researchShai-Hulud: ongoing package supply chain worm delivering data-stealing malware (Wiz)
- trackerSha1-Hulud 2.0 supply chain attack: 25K+ repos exposed (Wiz)
- researchShai-Hulud 2.0 aftermath: trends, victimology and impact (Wiz)
- researchShai-Hulud 2.0: host registered as SHA1HULUD runner
- researchShai-Hulud: self-replicating worm compromises 500+ npm packages
- researchInside Shai-Hulud's maw: how the npm worm exploits and propagates
- researchnpm supply chain attack: GitHub API exploitation (Trend Micro)
- trackerShai-Hulud npm supply chain attack
- researchMini Shai-Hulud: supply chain campaign targets SAP npm packages (Wiz)
- researchMini Shai-Hulud strikes again: 317 npm packages compromised (SafeDep)
- trackerHackers have compromised dozens of popular open source packages in an ongoing supply chain attack