Security
Your AI coding assistant is now a supply-chain attack surface, and npm's fix didn't close it
Every few months another npm worm shows up, gets a name, and the security blogs do a lap of honor. Shai-Hulud has been the recurring one since September 2025, and most engineers I talk to tune it out after the second or…
Every few months another npm worm shows up, gets a name, and the security blogs do a lap of honor. Shai-Hulud has been the recurring one since September 2025, and most engineers I talk to tune it out after the second or third wave — "another npm thing, not my stack." The wave that hit in August 2026 is worth a second look, because it stopped targeting npm's install process and started targeting the exact files your AI coding assistant reads on startup: .claude/settings.json, .vscode/tasks.json, your CI workflows. That's not a packaging problem anymore. That's a problem with how you've configured Claude Code, Cursor, or Copilot on every machine that opens the repo.
What actually happened
npm's own ecosystem made a real, structural fix this year. On June 9, 2026, GitHub announced that npm v12 would disable install-time lifecycle scripts (preinstall, postinstall, and implicit native builds) by default, shipping in July 2026 (evidenced — The Hacker News, July 2026; Semgrep, June 11, 2026). This closed off the single biggest code-execution path abused by worm campaigns going back to the original Shai-Hulud in September 2025 and the 2,100-plus-package "Second Coming" wave that Sonatype tracked through November 2025 (Sonatype, November 24, 2025). A 2022 academic estimate cited by Semgrep put install-script usage at roughly 2.2% of all npm packages — meaning the feature that enabled most of this damage was barely used for anything legitimate in the first place.
Attackers adapted within weeks. Backslash Security documented a campaign it calls "Here We Go Again," published August 5, 2026, affecting more than 800 npm packages representing roughly 2 billion monthly downloads (evidenced, vendor research — Backslash Security, August 5, 2026). Instead of relying on install scripts, the worm commits changes directly to reachable GitHub branches: it writes a .vscode/tasks.json entry that auto-runs a setup script when the repo opens in an IDE, and it modifies .claude/settings.json to register a Claude Code SessionStart hook that does the same thing the moment you start an AI coding session. Its credential collector specifically walks ~/.claude/, ~/.codex/, and ~/.cursor/ — the local config directories where AI coding tools cache session state and, in some setups, credentials. A companion Cloud Security Alliance research note on the broader Shai-Hulud family describes an even more direct variant that deploys fake MCP servers with tool descriptions containing hidden prompt-injection instructions, telling the connected assistant to read sensitive files and pass them back through normal tool calls without telling the user (evidenced — Cloud Security Alliance).
One more detail worth sitting with: Sonatype reported that when researchers fed the malicious packages to ChatGPT and Gemini for an automated safety check, both models classified them as safe. The payloads exceeded 200,000 lines of code, past what the models could hold in context, and the analysis lost track of the actual logic (evidenced, single vendor report — Sonatype, November 24, 2025). If your dependency review process leans on an LLM to eyeball a package and clear it, that's a false sense of safety, not a control.
Why it matters in practice
This isn't really an npm story anymore — it's a story about trust boundaries you probably haven't drawn yet. Most teams have CODEOWNERS rules on package.json and lockfiles. Very few have them on .claude/, .cursor/, .vscode/tasks.json, or .github/workflows/, even though those files now execute automatically and have direct access to whatever credentials your AI tooling can reach. A pull request that only touches a hook file or an MCP server config often doesn't trigger the same scrutiny as one touching application code — and that's exactly the gap this campaign is built to use.
The CSA note and Backslash both converge on the same practical fix, which is less about any one patch and more about applying code-review discipline to configuration that used to be invisible:
- Put CODEOWNERS and required review on
.claude/,.cursor/,.vscode/tasks.json, and.github/workflows/— treat them like production code, because they now run like it. - Audit every branch, not just
main— this campaign commits to any reachable branch, and a stale feature branch is as good a foothold as the default one. - Don't trust an unfamiliar MCP server because it's convenient. Require it to come from a known publisher, and read what its tools actually say they do before connecting it — prompt injection lives in the tool description, not just the code.
- Treat "disable install scripts" as one layer, not the fix. Upgrading to npm v12 defaults closes one door; it does nothing for a worm that already lives in your repo's hook files.
- If you rely on an LLM-based tool to triage dependency risk, know its context limit relative to the package size you're feeding it, and don't treat a "looks safe" verdict as a substitute for a human or a dedicated scanner on anything large or unfamiliar.
Context and debate
The naming and attribution here are messier than the vendor blog posts suggest. "Shai-Hulud," "Sha1-Hulud," "Mini Shai-Hulud," "SANDWORM_MODE," and "Here We Go Again" get used by different vendors (Wiz, Sonatype, Akamai, Backslash, OX Security, CSA) for overlapping or related but distinct campaigns between September 2025 and August 2026, and I could not independently confirm whether they share the same operators (disputed / unverified). Treat the package and download-count figures as self-reported by the vendor that found them — I did not find independent cross-confirmation of Backslash's "800 packages, 2 billion downloads" figure for the August wave, for instance.
I also could not find a confirmed Shai-Hulud-family incident dated in the last 72 hours (October 13–15, 2026) at the time of writing. The most recent documented wave I could verify is from August 5, 2026. I'm writing about this now because it's the most consequential and well-evidenced practical-security story affecting AI coding workflows currently on record, not because something broke this week — worth being upfront about given how fast this space moves.
Quotes and data points
- "There is no justifiable reason for running arbitrary shell scripts by default." — cited from an npm/cli GitHub issue (#8732), as quoted by Semgrep, June 11, 2026.
- npm v12 disables install-time lifecycle scripts by default; announced June 9, 2026, shipping July 2026. The Hacker News / Semgrep.
- "Here We Go Again" campaign: 800+ npm packages, ~2 billion monthly downloads, published August 5, 2026. Backslash Security.
- Sonatype tracked over 2,100 malicious packages in the November 2025 "Second Coming" wave (tracking ID sonatype-2025-007248), first reported by Wiz and Aikido. Sonatype, November 24, 2025.
- Malicious packages analyzed by ChatGPT and Gemini were classified as safe; payloads exceeded 200,000 lines of code, beyond model context limits. Sonatype, November 24, 2025.
- An academic estimate cited by Semgrep puts install-script usage at roughly 2.2% of npm packages.
Checklist
- Add CODEOWNERS / required review to
.claude/,.cursor/,.vscode/tasks.json, and.github/workflows/in every repo that uses AI coding tools. - Audit all branches (not just
main) for unexpected changes to IDE or AI-agent config files. - Confirm your npm toolchain is on v12 defaults (install scripts off) — and don't treat that as the whole fix.
- Inventory every MCP server connected to your team's AI coding tools; remove anything you can't trace to a trusted publisher.
- If you use an LLM to triage dependency or package safety, check its context window against the size of what you're feeding it — a "looks safe" verdict on an oversized payload isn't a verdict.
- Rotate credentials (npm, GitHub, cloud, SSH, LLM API keys) on any machine that opened a repo with unreviewed hook or MCP config changes.
Unverified claims or gaps
- Backslash's "800+ packages / ~2 billion monthly downloads" figure for the August 2026 "Here We Go Again" wave comes from a single vendor and I found no independent corroboration.
- Whether "Shai-Hulud," "Sha1-Hulud," "SANDWORM_MODE," "Mini Shai-Hulud," and "Here We Go Again" represent the same threat actor or coordinated campaigns, versus independent copycats, is not clearly established across sources.
- The exact effective date npm v12's script-disabling default reached general availability (vs. announcement date of June 9, 2026) is inconsistent across sources — some say the change took effect around June 10, with v12 itself shipping in July 2026.
- No incident specifically dated October 13–15, 2026 was found; this topic's most recent confirmed activity is August 5, 2026.
- The CSA research note's own publication date could not be precisely confirmed (its underlying PDF filename suggests April 25, 2026, but this wasn't stated explicitly on the page fetched).
Sources
- Backslash Security, "Shai-Hulud's New Frontier" ("Here We Go Again"), Backslash Security, August 5, 2026. https://www.backslash.security/blog/shai-huluds-new-frontier
- Sonatype Research Team, "The Second Coming of Shai-Hulud: Attackers Innovating on npm," Sonatype, November 24, 2025. https://www.sonatype.com/blog/the-second-coming-of-shai-hulud-attackers-innovating-on-npm
- Cloud Security Alliance, "Shai-Hulud: npm Worm Targeting AI Developer Toolchains," Cloud Security Alliance Research Labs, undated (circa April 2026). https://labs.cloudsecurityalliance.org/research/csa-research-note-shai-hulud-npm-worm-ai-developer-supply-ch/
- The Hacker News, "npm 12 Disables Install Scripts by Default," The Hacker News, July 2026. https://thehackernews.com/2026/07/npm-12-disables-install-scripts-by.html
- Semgrep, "RIP post/preinstall scripts: An obituary for the npm feature only TeamPCP will miss," Semgrep Blog, June 11, 2026. https://semgrep.dev/blog/2026/rip-npm-postinstall-scripts-npm-v12-default-change