The npm Supply-Chain Worm Is Self-Propagating Now: What Mini Shai-Hulud Means If You Run a Coding Agent
A couple of days ago I wrote up the Red Hat npm compromise, where the @redhat-cloud-services namespace got hijacked through a maintainer's GitHub account. That one was bad, but it was a single namespace. The wave it belongs to is the part that should actually change how you work, and it has a name: Mini Shai-Hulud, tracked as CVE-2026-45321 with a CVSS of 9.6.
The reason this one is different from "a bad package got published" is in the propagation. Mini Shai-Hulud is a real worm. It does not wait for a human to push the next malicious version. It steals the credentials it needs to push the next version itself, and it specifically goes looking for the tokens that sit on the machines of people like us: developers running coding agents that npm install all day. I run those agents, so this is the postmortem I actually read line by line.
How a registry worm spreads
On May 11, 2026, between 19:20 and 19:26 UTC, 84 malicious package artifacts went out across 42 packages in the @tanstack namespace. They were published by TanStack's own legitimate release pipeline, using its trusted OIDC identity, after attacker-controlled code hijacked the CI runner mid-workflow. Six minutes, dozens of poisoned versions, all signed by the real publisher.
Here is the self-propagation that makes it a worm rather than an incident. Once the payload steals credentials from one CI/CD pipeline, it enumerates every package that maintainer controls and publishes an infected version of each one. From there it spread within hours to Mistral AI, UiPath, and other maintainers, eventually touching more than 160 packages across npm and PyPI. Every compromised pipeline becomes a new launch point, and the registry itself does the distribution.
StepSecurity attributes the campaign to a group it calls TeamPCP, the same crew tied to the Aqua Security Trivy scanner compromise in March 2026 and the Bitwarden CLI npm package in April. This is not a one-off. It is an operator that keeps coming back to the same well.
The GitHub Actions chain that let it in
The interesting part for anyone who maintains a CI pipeline is exactly how the runner got hijacked. The compromise chained three things:
- A
pull_request_targettrigger, which runs workflows with access to repository secrets in the context of the base repo, even for pull requests from forks. - GitHub Actions cache poisoning, used to smuggle attacker-controlled content into a trusted build.
- Runtime memory extraction of the OIDC token directly from the Actions runner process, so the publish went out under the project's real short-lived identity.
No leaked npm token, no stolen password in the classic sense. The pipeline was tricked into minting its own legitimate publish credential and handing it over. That is the same trust-boundary problem I called out in the Red Hat writeup: provenance and OIDC move the soft spot from the registry to your CI identity, and most teams have spent far less effort hardening a GitHub Actions config than a production database.
Why this one targets coding agents specifically
This is the detail that the earlier incidents did not really have, and the reason I am writing a second post instead of letting the Red Hat one stand. The Mini Shai-Hulud payload is about 2.3 MB of obfuscated code, and once it runs it does two things that matter for anyone with an AI coding tool installed.
First, it harvests aggressively. It reads the Actions runner's process memory to pull every secret in scope, then sweeps more than 100 file paths on the host: cloud provider credentials, cryptocurrency wallets, messaging app tokens, and the configuration files for AI developer tools, including Claude Code. If you have read my note on the stolen Codex auth tokens, you already know why this stings: those agent config files hold long-lived bearer tokens in plaintext, with no expiry and no second factor. A worm that grabs them gets quiet, indefinite impersonation.
Second, it persists. The payload installs persistence hooks in Claude Code, in VS Code, and at the OS level, and those hooks are designed to survive a reboot. So the usual reflex of "I removed the bad dependency, I am fine" does not hold. You can npm uninstall the poisoned version, reboot, and still have a payload re-establishing itself from a hook you never looked at.
So "the bad versions are gone" is not the all-clear
For the affected namespaces, the malicious releases have largely been pulled. That fixes the spread. It does nothing for a machine that already ran an install during the window. If you installed from any of the affected scopes in the relevant period, especially in CI, the correct posture is assume-breach, not assume-clean, because the worm's entire design is to outlast the obvious cleanup.
What to actually do
Some of this overlaps the generic supply-chain advice, but the coding-agent and CI-hardening pieces are what I would prioritize given how this specific worm behaves:
- Treat any host that runs a coding agent as a credential vault. Rotate your Claude Code, Codex, cloud, and npm tokens. Open
~/.claudeand~/.codexand check what is stored there. Then look for persistence you did not create: new login items, unexpected shell rc additions, odd VS Code tasks or extensions, OS-level services you do not recognize. - Lock down GitHub Actions before the next worm, not after. Do not expose secrets to
pull_request_targetworkflows. Set least-privilegepermissions:blocks soid-token: writeis scoped only to the jobs that genuinely publish. Pin third-party actions to a full commit SHA rather than a moving tag, and require review on any change to workflow files. - Pin and disable install scripts where you can. A committed lockfile with integrity hashes stops a silently republished version from slipping in on the next install, and
npm install --ignore-scriptsneutralizes the whole install-time-execution class. I went deeper on both in the Red Hat breakdown. - Have an actual IR step for agent hosts. Because the persistence survives reboot, treat a suspected exposure like a compromised endpoint: rotate, hunt for hooks, and consider rebuilding the machine if you cannot account for what ran during the window.
The bigger pattern
Supply-chain attacks used to be "someone published a bad package." Mini Shai-Hulud is the next thing: self-replicating malware that uses the registry as its transport, targets the tools we build with, and digs in deep enough to survive the cleanup most people would do. AI coding agents are now first-class targets in that story, not because the agents are uniquely insecure, but because they sit on a pile of long-lived tokens and run on machines that install untrusted code constantly.
The takeaway I keep landing on is the same one from the Red Hat post, just louder: your dependency graph is exactly as trustworthy as the least-protected identity that can publish to anything you install, and that now includes the identity your coding agent carries. The teams that come through this fine are the ones who already decided their CI tokens and their agent config files were as sensitive as a production password, because in an attack built like this, they are.
Sources
- StepSecurity: Mini Shai-Hulud Is Back: A Self-Spreading Supply Chain Attack Compromises TanStack npm Packages
- Wiz Research: Mini Shai-Hulud Strikes Again: TanStack and More npm Packages Compromised
- Snyk: TanStack npm Packages Hit by Mini Shai-Hulud
- Tenable: Mini Shai-Hulud Supply Chain Attack CVE-2026-45321 FAQ
- The Hacker News: Mini Shai-Hulud Worm Compromises TanStack, Mistral AI, Guardrails AI and More Packages