IncidentSupply chain
Mini Shai-Hulud: worm hijacks release pipelines at TanStack and Mistral AI
CriticalTanStackMistral AIOpenAI
A self-spreading worm hijacked trusted release pipelines to publish credential-stealing versions of popular npm and PyPI packages, including 84 TanStack versions and Mistral AI's SDKs. It reached two OpenAI employee devices, and later waves planted hooks in Claude Code and VS Code settings so the malware kept running.
Replay the attack step by step in the Learning Center
How it happened
- The attacker opened a pull request from a fork; a pull_request_target workflow ran the fork's code with the main repository's privileges and poisoned the shared Actions cache.
- When the release workflow restored that cache, attacker code read the runner's memory, stole an OIDC publishing token and pushed 84 malicious versions in about six minutes.
- Installing a bad version stole GitHub, npm, cloud, Kubernetes and SSH secrets, then republished other packages the victim maintained.
- Later waves added a SessionStart hook to .claude/settings.json and a folderOpen task to .vscode/tasks.json for persistence.
Impact
Hundreds of packages were poisoned; OpenAI rotated its code-signing certificates and Mistral pulled its SDK releases.
The fix
TanStack deprecated all 84 versions within two hours and hardened its workflows. Victims must remove the persistence hooks first, then rotate every credential the machine could reach.
Lessons
- Never run fork code under pull_request_target, and never share caches between untrusted and release jobs.
- Trusted publishing proves where a package was built, not that its code is safe; still scan and pin.
- Agent config files (.claude/, .vscode/, AGENTS.md) are persistence targets now; review changes to them like CI config.