
One-command scanner for the Mini Shai-Hulud npm supply-chain worm (CVE-2026-45321). Detect before rotating tokens.
One-command scanner for the Mini Shai-Hulud npm supply-chain attack (CVE-2026-45321, CVSS 9.6).
The worm installs a persistence daemon (gh-token-monitor) that runs rm -rf ~ if it detects credential revocation. Do not rotate your GitHub PAT or npm token until you have confirmed the daemon is gone. Detect → remove the daemon → then rotate.
curl -fsSL https://raw.githubusercontent.com/prashanthnataraj/mini-shai-hulud-detector/main/shai-hulud-detector.sh | bash
Or download and inspect first (recommended for any script you pipe to a shell):
curl -fsSL https://raw.githubusercontent.com/prashanthnataraj/mini-shai-hulud-detector/main/shai-hulud-detector.sh -o shai-hulud-detector.sh
# Read it. Then:
bash shai-hulud-detector.sh
| Step | Check |
|---|---|
| 1 | @tanstack/setup phantom package in package-lock.json |
| 2 | Known malicious payload files (router_init.js, tanstack_runner.js) |
| 3 | Payload SHA-256 hashes against a known-bad list |
| 4 | gh-token-monitor persistence daemon (LaunchAgent / systemd / pgrep) |
| 5 | Unexpected PreToolUse / PostToolUse hooks in ~/.claude/settings.json |
| 6 | pull_request_target triggers and unpinned action refs in .github/workflows |
| Code | Verdict |
|---|---|
0 | CLEAN — no indicators found |
1 | SUSPICIOUS — manual review required |
2 | INFECTED — follow the remediation order exactly (see the script output) |
A missing
package-lock.jsonreturns SUSPICIOUS by design — run the scan afternpm install.
npm install, npm uninstall, or git push.rm -rf node_modules && npm install --ignore-scripts.Add to .npmrc:
ignore-scripts=true
minimum-release-age=4320
Pin all GitHub Actions to a full commit SHA, not a version tag.
Written after the Lume AI team encountered a live CVE-2026-45321 attack in May 2026. The script is read-only — no network calls after download, no writes to disk. Review the source before running it.
MIT — see LICENSE.