# Shai-Hulud npm worm: self-spreading malware stole npm, GitHub and cloud tokens

Source: https://botpassword.com/incidents/2025-09-shai-hulud-npm-worm
Disclosed: 2025-09-15 · Type: Supply chain · Status: Contained · Updated: 2026-10-25

In mid-September 2025 a self-replicating worm called Shai-Hulud spread through more than 500 npm packages. When installed, it ran TruffleHog over the machine to find secrets, published them to a public GitHub repository named `Shai-Hulud`, and used any npm token it found to inject itself into the victim's other packages. Anyone who installed an affected version should rotate npm, GitHub and cloud credentials on that machine or CI runner.

## What was exposed

Whatever secrets TruffleHog could find on the filesystem and in environment variables of the machine that ran `npm install`: npm tokens, GitHub personal access tokens and, according to CISA, API keys for AWS, Google Cloud and Microsoft Azure. Stolen values were sent to a `webhook.site` endpoint and written to a **public** GitHub repository named `Shai-Hulud` in the victim's account, so anyone could read them until the repository was removed. The worm also pushed a workflow named `shai-hulud-workflow.yml` to the victim's repositories to exfiltrate their GitHub Actions secrets. With a stolen npm token it published infected versions of every package that token could publish.

## Who is affected

You are affected if a developer machine or CI runner installed any compromised version during the outbreak, directly or as a nested dependency. CISA recommends treating versions published on or after 16 September 2025 as suspect until checked, and pinning to releases from before that date. Look for a public repository named `Shai-Hulud` in your GitHub account, a branch named `shai-hulud`, or a file `.github/workflows/shai-hulud-workflow.yml` in any repository you can push to. If you maintain npm packages, check whether versions you did not publish appeared on your packages.

## What to do

1. Search `package-lock.json`, `yarn.lock` and `pnpm-lock.yaml` across your projects, and your artifact caches, for the compromised versions published by StepSecurity, Socket and GitHub, and remove them.
2. Rotate every credential on affected machines and runners, starting with npm tokens, GitHub personal access tokens and cloud keys (AWS, Google Cloud, Azure).
3. Delete any `Shai-Hulud` repository, `shai-hulud` branch and `shai-hulud-workflow.yml` workflow, then rotate the GitHub Actions secrets of every repository where the workflow ran.
4. If you publish npm packages, check your packages for versions you did not release, unpublish or deprecate them, and switch to trusted publishing or short-lived granular tokens.
5. Turn on phishing-resistant MFA for GitHub and npm, remove unused GitHub Apps and OAuth apps, and block outbound traffic to `webhook.site` from build systems.

## Keys to rotate

- [npm](https://botpassword.com/keys/npm)
- [GitHub](https://botpassword.com/keys/github)
- [AWS (IAM access keys)](https://botpassword.com/keys/aws)
- [Google Cloud (service account keys and API keys)](https://botpassword.com/keys/google-cloud)
- [Azure (Microsoft Entra app client secrets)](https://botpassword.com/keys/azure)

## Timeline

- 2025-09-14: GitHub says it was notified of the attack on this date. ([source](https://github.blog/security/supply-chain-security/our-plan-for-a-more-secure-npm-supply-chain/))
- 2025-09-15: StepSecurity reports that `@ctrl/tinycolor` 4.1.1 and 4.1.2 and more than 40 other packages carry a `bundle.js` payload that runs TruffleHog and plants a GitHub Actions workflow. ([source](https://www.stepsecurity.io/blog/ctrl-tinycolor-and-40-npm-packages-compromised))
- 2025-09-22: GitHub says it removed more than 500 compromised packages, blocked uploads containing the worm's indicators, and announces plans to deprecate classic npm tokens and TOTP 2FA and to move publishing to short-lived tokens and trusted publishing. ([source](https://github.blog/security/supply-chain-security/our-plan-for-a-more-secure-npm-supply-chain/))
- 2025-09-23: CISA publishes an alert and advises rotating all developer credentials. ([source](https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem))

## Indicators

- `@ctrl/tinycolor` versions 4.1.1 and 4.1.2.
- A minified payload file `bundle.js` added to the package and run from a `postinstall` script.
- A public GitHub repository named `Shai-Hulud`, a branch `shai-hulud`, and `.github/workflows/shai-hulud-workflow.yml`.
- Outbound connections to `webhook.site`.

## Sources

- https://www.stepsecurity.io/blog/ctrl-tinycolor-and-40-npm-packages-compromised
- https://github.blog/security/supply-chain-security/our-plan-for-a-more-secure-npm-supply-chain/
- https://www.cisa.gov/news-events/alerts/2025/09/23/widespread-supply-chain-compromise-impacting-npm-ecosystem
