Supply chain · September 15, 2025

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

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.

DisclosedSeptember 15, 2025
Earliest known activitySeptember 14, 2025
Affectednpm, @ctrl/tinycolor, GitHub
TypeSupply chain
StatusContained

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.

Am I 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 now

  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

Guides to the credentials this incident put at risk:

Timeline

  1. GitHub says it was notified of the attack on this date. Source
  2. 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
  3. 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
  4. CISA publishes an alert and advises rotating all developer credentials. Source

Indicators

From the advisories listed below. Use them to search your logs, lockfiles and workflow runs.

  • @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.

What this changes for credential handling

  • The worm spread because install scripts could read long-lived publish tokens from disk. BotPassword keeps registry tokens out of plain files and injects them only into the command that needs them.

Frequently asked questions

Am I affected by the npm incident?

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 was exposed in the npm incident?

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.

Which keys should I rotate?

Rotate any npm, GitHub, AWS (IAM access keys), Google Cloud (service account keys and API keys), Azure (Microsoft Entra app client secrets) credentials that were reachable from affected systems, starting with the ones that can publish code or reach production.

Keep keys out of reach of the next compromised package

BotPassword is in early access. Request an invite and we'll email you when your spot opens.