Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised
TL;DR Highlight
One hijacked npm account pushed malicious versions to 317 packages in 22 minutes.
Who Should Read
A developer who relies on npm dependencies and also uses AI coding tools like Claude Code or Codex
Core Mechanics
- One account, 317 packages in 22 minutes
- The atool npm account was compromised on May 19, 2026.
- An automated burst published 637 malicious versions across 317 packages.
- size-sensor gets 4.2M downloads per month and echarts-for-react 3.8M.
- The latest tag gives no protection
- The attacker left the latest dist-tag untouched on most packages.
- npm still resolves a semver range to the highest matching version.
- A clean install of echarts-for-react ^3.0.6 resolves to malicious 3.2.7.
- preinstall runs on install alone
- Malicious versions run bun run index.js via a preinstall hook.
- 630 versions also add an optionalDependencies entry pointing to forged commits in antvis/G2.
- That path delivers the payload even if preinstall hooks are blocked.
- It steals everything from AWS to password managers
- It goes after the full AWS credential chain, including env vars, config files, EC2/ECS metadata and Secrets Manager.
- GitHub PATs, npm tokens, SSH keys, Kubernetes tokens and Vault tokens are targets.
- 1Password, Bitwarden, pass and gopass vaults are also targeted.
- It turns Claude Code, Codex and VS Code into persistence
- It injects SessionStart hooks into Claude Code and Codex to re-run the malware every AI session.
- VS Code gets a tasks.json with runOn: folderOpen for the same effect.
- It also spreads via commits to accessible GitHub repos.
- In CI it steals identity and republishes
- It exchanges GitHub Actions OIDC tokens for npm publish tokens.
- It signs artifacts with Sigstore using the stolen identity, so they look legitimately signed.
- It injects a codeql.yml workflow that dumps toJSON(secrets).
Community Reactions
- Opinion: lifecycle scripts should be off by default
- Commenters note every npm worm of this kind spread through them.
- They say most packages don't need them, so disable them globally.
- Some want a pnpm-style allowBuilds allowlist and approve-builds in npm.
- Experience: min-release-age and cooldowns are practical
- One commenter says npm config set min-release-age=2 avoids most attacks like this in practice.
- Another updates frontend dependencies only a few times a year with pnpm cooldowns and no build scripts.
- Warning: devcontainers and VMs aren't a full defense
- A commenter points out the worm tries Docker socket escape, so devcontainers are not safe by themselves.
- They advise rootless engines like podman instead of docker.
- Idea: audit upgrade diffs with AI, or vendor dependencies
- One commenter suggests a Claude instruction or skill that audits every upgrade diff as part of the workflow.
- Another spent a week re-implementing deep-dependency packages with Claude and Codex and froze them.
- Extra info: the list is incomplete
- A commenter reports the nx-console VS Code extension (2.2M downloads) was compromised the day before by the same worm.
How to Apply
- Turn on npm cooldown and script blocking today
- Run npm config set min-release-age=2 on dev machines and CI.
- Run npm config set ignore-scripts true to disable install scripts globally.
- Allow build scripts only for packages that truly need them.
- Check lockfiles and machines for IoCs
- Search lockfiles for atool-account packages and versions published 01:44-02:06 UTC on May 19.
- If you installed any, check .claude/settings.json, .vscode/tasks.json and the kitty-monitor service.
- Check your GitHub account for Dune-named repos and chore/add-codeql-static-analysis branches.
- Rotate all credentials if you suspect infection
- Revoke and reissue npm tokens, GitHub PATs, AWS keys and SSH keys on affected machines and CI.
- Include password manager vaults plus Kubernetes and Vault tokens.
- Add AI tool config files to PR review
- Make changes to .claude/settings.json SessionStart hooks and .vscode/tasks.json mandatory review items.
- Do not merge anything that calls an unfamiliar setup.mjs.
Try It
# Paste into Claude Code at the project root (read-only prompt to check for Mini Shai-Hulud infection traces)
Check this project and my home directory, read-only, for traces of the Mini Shai-Hulud npm supply chain attack. Do not modify any files.
Checks:
1. Lockfiles (package-lock.json / pnpm-lock.yaml / yarn.lock): versions published 2026-05-19 01:44-02:06 UTC, or packages whose preinstall is 'bun run index.js'
2. optionalDependencies containing 'github:antvis/G2#', especially SHAs 1916faa365f2788b6e193514872d51a242876569 and 7cb42f57561c321ecb09b4552802ae0ac55b3a7a
3. SessionStart hooks in .claude/settings.json, .claude/setup.mjs, .vscode/setup.mjs, and runOn: folderOpen in .vscode/tasks.json
4. .github/workflows/codeql.yml named 'Run Copilot' or using toJSON(secrets)
5. ~/.local/share/kitty/cat.py, ~/.local/bin/gh-token-monitor.sh, /var/tmp/.gh_update_state, kitty-monitor.service or com.user.kitty-monitor.plist
Summarize as a Found / Not found table and list credentials to rotate if anything is found.
Extra scope: {{paths or package names to check}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques
Related Resources
- https://safedep.io/mini-shai-hulud-strikes-again-314-npm-packages-compromised/
- https://pnpm.io/settings#allowbuilds
- https://pnpm.io/cli/approve-builds
- https://cooldowns.dev
- https://aube.en.dev/package-manager/jailed-builds.html
- https://npm-supply-chain-attacks-25-26.pagey.site/
- https://docs.deno.com/runtime/reference/std/
- https://blog.jgc.org/2026/04/raspberry-pi-as-isolated-ai-cod...