On May 11, 2026, between 19:20 and 19:26 UTC, an attacker published 84 malicious versions of 42 @tanstack/* packages to npm, each carrying a self propagating worm. It went out through the TanStack release workflow on GitHub Actions, authenticated by npm trusted publishing, and no npm token was stolen (TanStack, GHSA-g7cv-rxg3-hmpx). Twelve weeks later, the wave StepSecurity named ChainDrop reached 444 packages and 2,212 versions in under four hours. GitHub, which runs npm, describes a pattern of attacks that "target weaknesses in package repositories and CI/CD systems to quickly spread malware to hundreds of open source projects" (GitHub).
Researchers link these worms through shared code to one family, Shai-Hulud, first seen in September 2025. This post explains how one install turns into stolen npm and GitHub tokens, a republished package and a poisoned CI pipeline. Then come the npm, pnpm and GitHub Actions settings we would apply today, our test of the binding.gyp trick on six npm and pnpm versions, and a check for indicators of compromise (IOC).
Status on November 1, 2026: the most recent worm activity we found is the "testmetest" campaign of October 19 to 27, which GitHub flagged as malware on October 26 and 28. npm 12 is the current npm release, but no Node.js LTS line bundles it yet.
Key takeaways
- One stolen npm token is enough to spread. According to Microsoft, the ChainDrop payload takes every package the token can publish, adds itself and a
preinstallhook, bumps the patch version and republishes. - Valid provenance did not stop TanStack, ChainDrop or tensorlake, which all shipped from real release workflows.
- npm 10 and 11 ran our
binding.gyptest payload by default.--ignore-scripts, npm 12.2.1 and pnpm 10 to 12 blocked it, but only pnpm 11 and 12 failed the install by default, and npm 12.2.1 does so innpm ciwithstrict-allow-scripts=true. - A release age gate covers the usual window. npm removed the last malicious TanStack tarball 4 h 35 min after the first publish. pnpm 11 waits 24 hours by default, while npm needs
min-release-ageset by hand (npm 11.10.0 or later). - Remove the token monitor before revoking anything. Since May, payloads in this family can install a
gh-token-monitorservice, and in tensorlake it deletes the home directory once the stolen GitHub token is revoked (StepSecurity).
How one npm install becomes hundreds of infected packages
Microsoft Threat Intelligence described the full loop for ChainDrop on August 4 (Microsoft), and other 2026 waves reuse parts of it.

It runs during install. ChainDrop added a preinstall hook that starts setup.mjs, which fetches the Bun runtime and runs an obfuscated 727,680 byte bundle (StepSecurity). TanStack used a prepare script in a git dependency, and Phantom Gyp a binding.gyp file with no script at all.
It harvests tokens. On a laptop the payload keeps running after the install, and in CI it stays in the job to read workflow secrets and runner memory. Microsoft lists the GitHub CLI token, environment variables, credential files, shell histories, SSH keys and cloud configuration, which the malware tests against npm, GitHub, AWS, Kubernetes and Vault.
It republishes through npm. Each npm token is checked for write access and for the ability to bypass 2FA. In the words of Microsoft, the payload then "downloads their latest tarballs, inserts the malware and setup loader, adds a preinstall hook, increments the patch version, and republishes the modified packages."
It spreads through GitHub. With a GitHub token the worm commits .claude/settings.json, .vscode/tasks.json and their setup.mjs loaders into repository branches, so later Claude Code or VS Code sessions in that repository start the payload again. StepSecurity saw these commits under the author claude <claude@users.noreply.github.com>, with messages such as chore: update dependencies.
It publishes from CI under a real identity. If the job is configured for npm trusted publishing, the payload asks the runner for an OIDC token and publishes directly. "Packages published through this route can carry valid provenance because the publication originates from a legitimate workflow identity," Microsoft writes.
The waves from September 2025 to October 2026

- September 2025, Shai-Hulud. The first wave spread through compromised maintainer accounts and malicious
postinstallscripts, and CISA counted "over 500 packages" (CISA). - November 24, 2025, Shai-Hulud 2.0. Execution moved to
preinstallwith asetup_bun.jsloader (Microsoft), and GitHub says it added destructive functionality (GitHub). - May 11, 2026, Mini Shai-Hulud. Besides the 42 TanStack packages (CVE-2026-45321, CVSS 9.6), the wave hit Mistral AI, UiPath and OpenSearch packages (StepSecurity). Microsoft counts 170+ npm and 2 PyPI packages.
- June 1, Miasma at Red Hat. 32 packages under
@redhat-cloud-serviceswere published through the upstream CI/CD pipeline of the project (Microsoft). - June 3 and 4, Miasma again, via Phantom Gyp. 57 packages and 286+ versions in under two hours, started through
binding.gyp(StepSecurity). - August 4, ChainDrop.
keyv@6.0.0went out at 09:35 UTC from the project release workflow after the maintainer GitHub account was taken over, and by 13:20 the worm had added 433 packages to the 11 first carriers (StepSecurity). - October 7 and 8, tensorlake 0.5.144. Eight commits went straight to
mainunder a maintainer name, and the release workflow published the result with provenance (StepSecurity). - October 19 to 27, testmetest. SafeDep followed 19 packages from one operator (SafeDep), and JFrog found 42 armed GitHub repositories across 11 owners, with 12.9 to 13.7 MB payload files that GitHub code search did not index (JFrog).
Trackers count at different times, so for ChainDrop Microsoft reports "more than 400 packages" and StepSecurity 444.
How malicious releases got valid provenance
The TanStack postmortem describes a publish that never needed an npm token: "No npm tokens were stolen and the npm publish workflow itself was not compromised." A fork pull request triggered bundle-size.yml, a pull_request_target workflow, whose code saved a poisoned 1.1 GB pnpm store into the Actions cache under the key the release workflow restores. When the release ran on main that evening, the attacker binaries minted an OIDC token through the legitimate id-token: write permission and published.
TanStack notes that the cache save in actions/cache "is not gated by permissions:", and its lesson reads: "OIDC trusted-publisher binding has no per-publish review. Once configured, any code path in the workflow can mint a publish-capable token."
ChainDrop and tensorlake took a shorter path, with commits pushed under a maintainer identity and published by the real pipeline. As StepSecurity put it after ChainDrop, "Provenance proves which commit was built. It cannot prove the commit was authorized."
binding.gyp: an install hook with no script in package.json
The npm documentation states that if a package has a binding.gyp file in its root and no install or preinstall script, npm runs node-gyp rebuild as its install command (npm). GYP files can run shell commands through <!(...) expansion while the build is configured. The Phantom Gyp packages shipped a 157 byte binding.gyp with "<!(node index.js > /dev/null 2>&1 && echo stub.c)" and no install script, so tools that read only the scripts field had nothing to flag (Snyk).
On November 1 we packed a harmless test package with the same pattern: its binding.gyp runs a script that only writes a marker file, and its package.json has no scripts. We installed it from a local tarball with six npm and pnpm versions on Node 26.13.0 under Linux, with control runs that allowed all scripts to prove the probe works.

npm 10.9.9, the version bundled with Node 22.23.4, and npm 11.21.1 ran the payload by default. --ignore-scripts stopped it on both. npm 12.2.1 and pnpm 10.34.9 blocked it with a warning, and npm named the hidden script: gyp-probe@1.0.0 (install: node-gyp rebuild). pnpm 11.28.9 and 12.16.1 blocked it and failed the install with ERR_PNPM_IGNORED_BUILDS.
Three results matter for CI. With strict-allow-scripts=true, npm 12.2.1 failed npm ci and a plain npm install on the binding.gyp package with ESTRICTALLOWSCRIPTS, because the lockfile marks it with hasInstallScript, while the first npm install <package> that added it only warned and exited with code 0. On npm 11.21.1 the same setting still let npm install <package> run the payload. Approving the package with npm install-scripts approve and running npm rebuild ran the payload, so an approval means running whatever that exact version contains.
The attackers have already moved past install hooks. During testmetest, SafeDep saw the trigger change from binding.gyp to a postinstall script that loads a native addon on October 26, and a day later to an addon that "now starts the worm when an application imports the package, so --ignore-scripts does not protect you." Script blocking closes the install path only, so the release age gate and lockfile review have to catch a package that starts on import.
How long a bad version stays installable

In the waves with a public timeline, detection took minutes. TanStack counts 26 minutes from the first malicious publish to public detection and 1 h 43 min until all 84 versions were deprecated. Deprecated versions stay installable, though, and npm removed the malicious tarballs between 2 h 53 min and 4 h 35 min after the first publish. ChainDrop drew its first public GitHub issue 43 minutes after keyv@6.0.0 went out, and StepSecurity reports all 11 carrier packages back on safe versions by 18:10 UTC, at most 8 h 35 min after the first publish, while packages from the second wave were still being removed.
The pnpm documentation says that "In most cases, malicious releases are discovered and removed from the registry within an hour." The gate still needs someone to report the version, and StepSecurity found tensorlake 0.5.144 downloadable when it published its report, so pair the gate with a reviewed lockfile and an advisory feed.
What we would change in a Node.js project today
These are the controls we would check first on any repository that installs dependencies in CI or publishes to npm, with the version each one needs.
1. Know which npm runs your installs. On November 1, Node 22.23.4 bundles npm 10.9.9, Node 24.22.2 bundles npm 11.19.1 and Node 26.13.0 bundles npm 11.20.0 (Node.js release index). npm 12 needs Node ^22.22.2, ^24.15.0 or 26 and later, so install it on purpose in CI and print npm -v. npm 10 has no min-release-age and accepts the line in .npmrc without a warning (our check on npm 10.9.9).
2. Set a release age for every install. npm 11.10.0 and later reads min-release-age in days, and Dependabot version updates have waited three days by default since July 2026 (GitHub). pnpm reads minimumReleaseAge in minutes (10.16.0 and later) and defaults to 1440 since pnpm 11, but that built in default falls back to a newer version when nothing old enough matches, while a value you set yourself is strict. We use seven days in the examples below, and the pnpm 12 release notes give one more reason to check the config by hand: before 12.0, "a misspelled minimumReleaseAge dropped the policy it was meant to set, and nothing said so."
# .npmrc
min-release-age=7 # days, npm 11.10.0+
min-release-age-exclude[]=@yourorg/* # your own packages may update at once
allow-git=none # default in npm 12, "all" in npm 11
allow-remote=none # default in npm 12: no dependencies from tarball URLs
strict-allow-scripts=true # npm 11.18+ and 12: unreviewed install scripts fail npm ci
# On npm 10 or 11 add: ignore-scripts=true, then rebuild native packages explicitly# pnpm-workspace.yaml (pnpm 11 or 12)
minimumReleaseAge: 10080 # 7 days in minutes; an explicit value is strict
minimumReleaseAgeExclude:
- '@yourorg/*'
blockExoticSubdeps: true # default since pnpm 11: no git or URL transitive deps
strictDepBuilds: true # default since pnpm 11: unlisted build scripts fail
trustPolicy: no-downgrade # fail if a release has weaker trust evidence than earlier ones
allowBuilds:
esbuild: true
sharp: truetrustPolicy: no-downgrade would not have caught TanStack or the ChainDrop carriers, which went out through their own trusted publishers, but it fails on a token published release of a package that normally uses trusted publishing, which is how ChainDrop spread further (Microsoft). For an urgent fix, exclude only the patched version, which pnpm audit --fix does on its own.
3. Allow install scripts per package and version. npm has had an opt in allowScripts policy since 11.16.0 and enforces it by default since 12.0.0, so on npm 12 run npm install-scripts ls, review each package, then npm install-scripts approve sharp. Approvals are written as pinned entries such as sharp@0.35.5, so a new version of an approved package is blocked again until someone reviews it. Set strict-allow-scripts=true so npm ci fails on unreviewed packages, and keep the log check below for installs that add a new package, which only warn.
- name: Install dependencies, fail on any blocked install script
run: |
set -o pipefail
npm ci 2>&1 | tee npm-ci.log
# without strict-allow-scripts, npm 12.2.1 only warns for an implicit node-gyp rebuild (our test)
! grep -q "had install scripts blocked" npm-ci.log4. Treat the lockfile as reviewed code. Install with npm ci or pnpm install --frozen-lockfile in CI, and change the lockfile only in its own pull request. In that diff, look for new resolved hosts, git or tarball URLs and packages that gained install scripts, then run npm audit signatures after the install.
5. Publish without long lived tokens, and with a human in the loop. npm trusted publishing needs npm CLI 11.5.1 and Node 22.14.0 or later, and does not support self hosted runners yet (npm). After switching, set the package to "Require two-factor authentication and disallow tokens". Then configure the trusted publisher for npm stage publish only (npm CLI 11.15.0 or later), so every CI release waits for a maintainer to approve it with 2FA, which closes the gap the TanStack postmortem describes.
6. Pin GitHub Actions and limit what each job can do. Pin every action to a full commit SHA, or try the workflow lockfile .github/workflows/actions.lock (public preview since October 14, 2026), which also locks the actions your actions call (GitHub). Keep Dependabot updating pinned actions, because the June fix in actions/checkout reached floating tags like @v4 automatically on July 20, while SHA pinned workflows needed an update (GitHub).
permissions:
contents: read # every job starts read only
cache-mode: read # restore only; GA since September 10, 2026
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with: { node-version: 24 }
- run: npm install -g npm@12.2.1 && npm -v
- run: npm ci
- run: npm pack # the release tarball is built here, not in the publish job
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: { name: package, path: '*.tgz' }
publish:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: npm-release # protected environment with required reviewers
permissions:
contents: read
id-token: write # only this job can mint an OIDC token
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with: { name: package }
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with: { node-version: 24 }
- run: npm install -g npm@12.2.1
- run: npm stage publish ./*.tgz --ignore-scripts # needs npm 11.15.0+; a maintainer approves with 2FAThe publish job installs no dependencies and runs no package scripts, because any code in a job with id-token: write can mint a publish token. Avoid pull_request_target for anything that builds or runs pull request code. GitHub turns on a default rule that disables it in public repositories on December 2, 2026, and the rule does not cover private or internal repositories (GitHub).
7. Treat developer machines and agent configs as part of the pipeline. The worms write .claude/, .vscode/, .cursor/rules/, .gemini/ and .github/ files because those run commands when someone opens the project, so put these paths under CODEOWNERS and review them like code. Far from npm, Binance said its initial investigation of the October incident suggests it may involve a compromised DevOps engineer laptop, which we covered in our Binance hack breakdown.
A read only IOC check you can run today
The script below changes nothing on disk and prints what it finds, using indicators from reports by Microsoft, StepSecurity, Snyk, SafeDep and JFrog. Section 4 sends the package names and versions in each lockfile to the npm audit endpoint, which answers with GitHub malware advisories. Run it on every developer laptop and self hosted runner, pointed at the folder with your repositories.
#!/usr/bin/env bash
# Read only check for known Shai-Hulud family indicators (Sep 2025 to Oct 2026). Changes nothing on disk.
# Usage: bash ioc-check.sh ~/code
ROOT="${1:-$HOME}"
HOOKS='setup\.mjs|\.github/init\.js|math_init\.js'
echo "== 1. Token monitor (wipes your home directory if you revoke the stolen GitHub token first)"
ls -la ~/.config/systemd/user/gh-token-monitor.service ~/.local/bin/gh-token-monitor.sh \
~/.config/gh-token-monitor ~/Library/LaunchAgents/com.user.gh-token-monitor.plist 2>/dev/null
echo "== 2. Worm files and agent or editor hooks in repositories and in ~/.claude"
find "$ROOT" -maxdepth 6 -not -path '*/node_modules/*' \( -path '*/.claude/setup.mjs' -o -path '*/.claude/math_init.js' \
-o -path '*/.vscode/setup.mjs' -o -path '*/.cursor/rules/setup.mdc' -o -path '*/.github/setup.js' -o -path '*/.github/init.js' \) 2>/dev/null
grep -rlE --exclude-dir=node_modules --include=settings.json --include=tasks.json --include=mcp.json "$HOOKS" "$ROOT" 2>/dev/null
grep -lE "$HOOKS" ~/.claude/settings.json ~/.claude/settings.local.json 2>/dev/null
echo "== 3. Payload files in node_modules"
find "$ROOT" -path '*/node_modules/*' -type f \( -name router_init.js -o -name tanstack_runner.js -o -name .napi_cache \) 2>/dev/null
find "$ROOT" -path '*/node_modules/*' -type f \( -iname Math_Symbol.js -o -iname math_init.js \) -size +100k 2>/dev/null # a legit 1 KB Math_Symbol.js exists
find "$ROOT" -path '*/node_modules/*' -name setup.mjs -exec grep -l 'oven-sh/bun' {} + 2>/dev/null
find "$ROOT" -path '*/node_modules/*' -name binding.gyp -exec grep -l 'stub.c' {} + 2>/dev/null # sharp legitimately uses <!( too
echo "== 4. Lockfiles against GitHub malware advisories (sends package names and versions to the npm registry)"
find "$ROOT" -name package-lock.json -not -path '*/node_modules/*' -execdir sh -c \
'npm audit --package-lock-only --json 2>/dev/null | grep -oE "(Malware|Malicious code) in [^\"]+" | sort -u | sed "s|^|$PWD: |"' \; 2>/dev/null
command -v pnpm >/dev/null && find "$ROOT" -name pnpm-lock.yaml -not -path '*/node_modules/*' -execdir sh -c \
'pnpm audit --json 2>/dev/null | grep -oE "(Malware|Malicious code) in [^\"]+" | sort -u | sed "s|^|$PWD: |"' \; 2>/dev/null
grep -rnE --include=pnpm-lock.yaml '@tanstack/setup|(^|[^a-z0-9-])(keyv@6\.0\.0|flat-cache@6\.1\.24|file-entry-cache@11\.1\.6|cacheable@2\.5\.1|cacheable-request@13\.0\.20|cache-manager@7\.2\.10|ecto@5\.0\.1|tensorlake@0\.5\.144)|@cacheable/(memory@2\.2\.1|utils@2\.5\.1|node-cache@3\.1\.2|net@2\.1\.1)' \
"$ROOT" 2>/dev/null | grep -v '/node_modules/' # offline fallback for pnpm; Yarn users: yarn npm audit
echo "== 5. Worm commits and branches in local clones"
find "$ROOT" -maxdepth 4 -name .git -not -path '*/node_modules/*' -prune 2>/dev/null | while read -r g; do d="${g%/.git}"
git -C "$d" log --all --since=2025-09-01 --date=short --format="$d %h %ad %ae %s" --author='claude@users.noreply.github.com'
git -C "$d" log --all --since=2025-09-01 --date=short --format="$d %h %ad %ae %s" --author='github-actions@github.com' \
--grep='chore: update dependencies \[skip ci\]'
git -C "$d" log --all --since=2025-09-01 --date=short --format="$d %h %ad %ae %s" -- .claude/setup.mjs \
.claude/math_init.js .vscode/setup.mjs .cursor/rules/setup.mdc .github/setup.js .github/init.js
git -C "$d" branch -a | grep 'dependabot/github_actions/format/' | sed "s|^|$d |"
done 2>/dev/null
echo "== 6. Exfiltration repositories on your GitHub account (needs: gh auth login)"
gh repo list --limit 1000 --json name,description \
--jq '.[] | select((.description // "") | test("Shai-Hulud|duluH-iahS|Spreading Blight"; "i")) | .name'If section 1 prints anything, do not revoke tokens yet. Back up what you cannot lose, stop and remove the monitor service, and only then isolate the machine and rotate npm, GitHub, cloud and SSH credentials from a clean machine. StepSecurity found that in tensorlake, revoking the GitHub token while the monitor runs triggers rm -rf ~/.
We ran a version of this check on our main development laptop on October 25, 2026, across 46 lockfiles and every node_modules folder in our project directory. It found no known bad versions, no worm files in repositories, no token monitor and no Bun downloads in /tmp. Two hits were legitimate: four Math_Symbol.js files of about 1 KB from regenerate-unicode-properties, and binding.gyp files in sharp and msgpackr-extract that compile real native code.
Hooks in ~/.claude/settings.json exist on our machines too, because we use them to load project context, so a hit in that file means reading the command each hook runs, not deleting the file. On November 1 we tested the script itself on a folder with planted dummy indicators, and sections 1 to 5 caught each of them.
What a clean result does not prove. The check matches known file names, versions, strings and published malware advisories, and a new wave with new names passes it until someone files an advisory, as the testmetest builds did against published Miasma signatures. It cannot see installs deleted since. Our own October 25 check covered one development laptop. A payload that starts on import runs wherever the application runs, so only lockfile review and advisory feeds stop it before production.
If you want an outside review of a Node.js build and release pipeline, our web development team sets up and audits npm, pnpm and GitHub Actions configurations for production applications.
Frequently Asked Questions
Supply chain review for Node.js teams
We check your npm, pnpm and GitHub Actions setup against the 2026 worm techniques and show which install or release step a stolen token could reach.
Book a free technical validationSources
Test results for binding.gyp come from our own runs on November 1, 2026. Everything else is attributed in the text.
- TanStack, Postmortem: TanStack npm supply-chain compromise, May 2026, and GitHub Advisory GHSA-g7cv-rxg3-hmpx (CVE-2026-45321), May 12, 2026
- GitHub, Disrupting supply chain attacks on npm and GitHub Actions, July 28, 2026
- GitHub, Strengthening supply chain security: Preparing for the next malware campaign, December 23, 2025
- GitHub changelog: checkout v7 and pull_request_target (June 18, 2026), cache-mode (September 10), workflow execution protections (September 17), workflow lockfiles (October 14)
- GitHub Advisory Database, malware advisories GHSA-7pvr-f92m-6fwg (October 26, 2026) and GHSA-4g45-28rv-vq9q (October 28, 2026)
- npm, v12.0.0 release notes (July 8, 2026), v11.10.0 release notes (February 11, 2026), v11.16.0 (May 27, 2026), config, npm install-scripts, scripts, trusted publishers, verifying registry signatures
- pnpm, dependency resolution settings, v11.0.0 release (April 28, 2026), v12.0.0 release (August 26, 2026)
- Node.js, release index, read November 1, 2026
- CISA, Alert on the Shai-Hulud npm compromise, September 23, 2025
- Microsoft Threat Intelligence, ChainDrop supply chain compromise (August 4, 2026), Red Hat npm Miasma campaign (June 2, 2026), Shai-Hulud 2.0 guidance (December 9, 2025, updated for Mini Shai-Hulud)
- StepSecurity, ChainDrop (August 4, 2026), Mini Shai-Hulud (May 2026), Phantom Gyp (June 3, 2026), tensorlake (October 8, 2026)
- Snyk, Node-gyp supply chain compromise, June 4, 2026
- SafeDep, testmetest npm packages carry a new Miasma worm variant, updated October 27, 2026
- JFrog Security Research, Beyond testmetest, October 2026
- Binance, Security Incident Update, October 30, 2026