metir
metir
Download on App StoreGet it on Google PlayF1 FantasyLoginSign Up
Back to Blog
Cybersecurity
Supply Chain
npm
AI Coding
Claude Code
DevSecOps

ChainDrop: The npm Worm That Hides Inside Your AI Coding Assistant

Microsoft Threat Intelligence disclosed ChainDrop on August 4, 2026, a self-propagating npm worm that poisoned 400+ packages and wrote itself into AI coding agent config files. A neutral, technical explainer of how it works and what it means.

Metir AI TeamAugust 6, 20269 min read
ChainDrop: The npm Worm That Hides Inside Your AI Coding Assistant

On August 4, 2026, Microsoft Threat Intelligence disclosed ChainDrop, a self-propagating worm that compromised more than 400 npm packages. What sets it apart from the long line of npm supply chain incidents before it is the target it chose for persistence. Alongside the usual credential theft, ChainDrop writes malicious entries into the configuration files that AI coding assistants read, turning developer trust in those tools into a way to keep spreading. It is an early, concrete example of a threat the security community had been warning about in the abstract: attacks that treat AI coding agents as part of the attack surface.

Microsoft logoMicrosoft
ChainDrop was disclosed by Microsoft Threat Intelligence on August 4, 2026.
Aug 4, 2026ChainDrop disclosedby Microsoft Threat Intelligence
400+npm packages compromisedacross many maintainers
2,212Malicious package iterationsobserved in under four hours
2AI/editor config files targetedfor persistence and spread

What ChainDrop is

ChainDrop is a worm, which is the important word. Most supply chain compromises are one-shot: an attacker poisons a package, and the damage is limited to who installs it before it is caught. A worm removes the human from the loop and spreads on its own. Microsoft's analysis describes ChainDrop as a variant in the Shai-Hulud lineage of npm worms, delivered as a large, heavily obfuscated JavaScript payload built with the Bun runtime, and executed through an npm preinstall lifecycle hook so that it runs before a package even finishes installing.

That preinstall detail matters. Many developers assume nothing dangerous happens until they actually import and run a dependency. A preinstall hook fires during the install step itself, on the developer's machine or, just as often, on a continuous integration runner that holds the keys to everything.

A security researcher examining hardware under a microscope at the DEF CON security conference
A researcher at work in the hardware-hacking area of DEF CON 24. The security community had flagged the risk of self-propagating, agent-aware attacks well before ChainDrop appeared. Photo by ArnoldReinhold via Wikimedia Commons, CC BY-SA 3.0. Illustrative; not a depiction of ChainDrop.

How it spreads

The mechanics are worth walking through, because the speed is the point. Once ChainDrop obtains a valid npm publishing token, everything after is automated.

How a self-propagating package worm spreads

ChainDrop needs no human at each hop. Once it holds a publishing token, each of these steps runs automatically, which is why it produced thousands of poisoned releases in hours.

1
Steal a publishing token
A malicious preinstall hook runs on install and harvests npm and GitHub credentials from the developer machine or CI runner.
2
Enumerate the victim’s packages
Using the stolen npm token, it lists every package that identity is allowed to publish.
3
Inject and repackage
It downloads each package’s latest tarball, inserts the obfuscated Bun payload and a setup loader, and adds its own preinstall hook.
4
Bump the version and republish
It increments the patch version and pushes the poisoned release, so ordinary updates pull the malware.
5
Persist through AI config files
With stolen GitHub credentials it writes .claude/settings.json and .vscode/tasks.json into repositories, creating a developer-to-developer infection path.

Microsoft Threat Intelligence observed 2,212 malicious package iterations on August 4, 2026, in under four hours.

Because each compromised maintainer's full set of packages gets poisoned and republished at once, and because the worm also re-published many historical versions, the volume balloons fast. Microsoft observed 2,212 malicious package iterations on August 4 in under four hours. No attacker was sitting at a keyboard approving each one; the worm was doing what worms do.

The AI twist

Credential theft and self-propagation are, by 2026, a familiar template. The novel move is where ChainDrop chooses to hide. Using stolen GitHub credentials, it injects two files into repositories: the ".claude/settings.json" and ".vscode/tasks.json" configuration files.

Why these two files are the point

ChainDrop does not just steal credentials. It writes itself into the files that tell AI coding tools what they are allowed to do, turning developer trust in those agents into a distribution channel.

.claude/settings.json
Governs
How Claude-based coding agents load instructions, which tools they are allowed to call, and which actions run without asking.
Why poisoning it works
A poisoned entry can silently widen what the agent is permitted to do, or trigger commands the moment the project loads.
.vscode/tasks.json
Governs
Editor tasks that can run automatically on folder open or build in Visual Studio Code.
Why poisoning it works
A malicious task re-runs the payload every time the repository is opened, reinfecting a cleaned machine.

The files that make AI coding agents convenient, unattended actions and auto-loaded instructions, are exactly what make them a persistence mechanism when compromised.

These are not random files. They govern how AI coding agents and the editor behave: which instructions load automatically, which tools an agent is allowed to call, and which actions run without a human confirming them. Poisoning them accomplishes two things at once. It establishes persistence, because a cleaned machine reinfects itself the next time the repository is opened and the tasks or agent instructions run again. And it creates a developer-to-developer infection path that does not depend on npm at all: clone an infected repo, open it in a configured editor or agent, and the payload has a foothold.

“

The features that make AI coding agents convenient, auto-loaded instructions and unattended actions, are exactly what make them a place to hide.

The uncomfortable insight is that this is not a flaw in any single AI tool. It is a consequence of how agentic assistants are designed to work. Their value comes from acting with minimal friction: reading project instructions on load, trusting a declared set of tools, and running steps without asking each time. Those same properties are what a worm wants from a persistence mechanism. The security research community had flagged exactly this class of risk. A BSides Las Vegas session on agentic worm risk landed almost on top of the disclosure, an uncomfortably well-timed warning.

What defenders can actually do

The mitigations for ChainDrop are, reassuringly, mostly known supply chain hygiene rather than anything exotic. Pin dependencies to exact versions and verify integrity hashes so an auto-bumped patch release does not silently pull the poisoned build. Disable or sandbox install scripts where you can, since the preinstall hook is the ignition. Scope and rotate npm and GitHub tokens aggressively, and keep publishing credentials off developer laptops and out of long-lived CI environment variables. Treat CI runners as high-value targets, because they usually are.

The AI-specific lesson is the one that is genuinely new. Configuration files that control what an AI coding agent is allowed to do should be treated as security-critical code, not as convenient local settings. That means keeping them under version control, reviewing changes to them in pull requests the way you would review a change to a build script, and being deliberate about which tools and unattended actions an agent is actually granted. An agent that can run arbitrary commands the instant a project loads is powerful, and that power is precisely what an attacker inherits if the config is compromised.

Preinstall hookThe ignition pointruns during npm install, before code is imported
Pinned versionsFirst-line defenseblocks silent auto-bumped patch releases
Scoped tokensLimit the blast radiusrotate npm and GitHub credentials
Reviewed configsThe new hygienetreat agent settings as code

The Metir angle, briefly

The broader shift ChainDrop illustrates is that AI agents are now infrastructure, and infrastructure has to be governed. As teams give agents more autonomy across more tools, the questions that matter are which tools an agent can reach, what it may do without a human in the loop, and whether those permissions are visible and reviewable. That governance mindset, deciding deliberately what an agent is allowed to touch rather than defaulting to maximum convenience, is the same discipline that makes a platform like Metir AI safe to run agentic work on. The tooling differs; the principle is identical. An agent's permissions are part of your security perimeter.

The bigger picture

ChainDrop is not the first npm worm and will not be the last. Its significance is the signpost. As AI coding assistants move from novelty to default, their configuration and their trusted-tool lists become a target worth attacking, and the same automation that makes them productive makes an attack that reaches them spread faster. The defensive playbook is not a mystery, but it does require extending old supply chain discipline to a new surface. The teams that come through incidents like this best will be the ones that already treat what their AI agents are allowed to do as a decision to be made and reviewed, not a default to be accepted.

Sources:

  • ChainDrop supply chain compromise: anatomy of a self-propagating worm | Microsoft Security Blog
  • Over 400 NPM Packages Infected in ChainDrop Supply Chain Attack | SecurityWeek
  • ChainDrop credential stealing worm infects over 400 npm packages | CSO Online
  • Shai-Hulud strikes again: CHAINDROP worm hits 400+ npm packages | Elastic Security Labs
  • BSides Las Vegas AI Track Warned of Agentic Worm Risk the Day Before ChainDrop Hit | Tech Times

Image credits

Header image: autonomous cyber-reasoning systems at the DARPA Cyber Grand Challenge, DEF CON 24, by Tony Webster via Wikimedia Commons, licensed under CC BY 2.0. Illustrative image of the security-research community; it does not depict ChainDrop.

Ready to experience AI that adapts to you?

metir brings together the world's best AI models in one seamless experience. Start for free today.

Get Started Free
metir

Agentic Operating System for Professionals buried in meetings, emails and docs.

© 2026 metir. All rights reserved.

Product

  • Features
  • Pricing
  • Research
  • Blog
  • Enterprise

Company

  • Support
  • Careers

Legal

  • Terms of Service
  • Privacy Policy

Personalisation is powerful. Privacy is non-negotiable.

Status: All systems operational