Skip to main content
  1. Posts/

IronWorm: A Self-Propagating npm Worm Built to Steal Machine Identities

A trusted package, a silent install, a new victim
#

A package you have installed a hundred times ships a new patch version. The changelog looks routine. You run npm install, and before the prompt returns, a Rust binary has already swept your environment variables, copied your cloud and AI provider keys, and started looking for credentials it can use to publish the next batch of infected packages under someone else’s name.

That is the IronWorm pattern, and it ran in the open across the npm registry during the first week of June 2026. Researchers tracking it counted 36 affected packages with a combined 32,000 monthly downloads before the operator quietly pulled them. No CVE was assigned. There was nothing to click and nothing to approve. The install hook did the work.

What IronWorm actually does
#

The malware arrives inside packages republished from a compromised npm account. Each one carries a Rust ELF binary that executes through a preinstall hook, so it fires automatically the moment the package is installed in a developer workstation or a CI runner.

Once running, it goes hunting. It sweeps roughly 86 environment variables and more than 20 credential file paths, covering AWS, GCP, Azure, Vault, Kubernetes, Docker, npm, and GitHub. It also targets the current generation of AI provider keys, including Anthropic, OpenAI, Gemini, and others, plus a dedicated routine for capturing cryptocurrency wallet seed phrases.

The engineering is deliberate. The binary hides behind an eBPF kernel rootkit that conceals its own processes, files, and network activity from host tooling. It encrypts internal strings with a unique key per call site rather than a single hardcoded key, which slows down static analysis. Command and control runs over Tor, with the implant pulling down its own Tor bundle and beaconing to a hidden service. This is not a few hundred lines of obfuscated JavaScript. It is a compiled, evasive infostealer that happens to travel through a package manager.

The part that should worry you: it publishes itself
#

Credential theft is the opening move. The propagation is what makes IronWorm a worm rather than a stealer.

After collecting secrets, it uses the victim’s own npm credentials to publish trojanized versions of packages the victim owns. That includes secrets tied to npm’s Trusted Publishing workflow, the OIDC-based mechanism teams adopted specifically to stop static token theft. Those republished packages then infect the next developer or pipeline that pulls them, and the cycle repeats. Researchers also found 57 backdated malicious commits spread across nine GitHub organizations, with timestamps copied from each repository’s last legitimate commit so the changes would survive a routine code review.

If the self-replicating behavior feels familiar, it should. IronWorm shares architectural DNA with the Shai-Hulud worm from last year, which means this approach is becoming a pattern rather than a one-off.

The dangerous capability here is not the rootkit. It is that the worm propagates using the identity controls you put in place to be safer. Trusted Publishing and OIDC tokens were supposed to reduce credential risk. IronWorm treats them as a distribution network. Any team relying on those mechanisms without scoping and monitoring them is one compromised dependency away from publishing malware in their own name.

Why this is a non-human identity problem
#

Most coverage of IronWorm files it under “another npm attack.” That framing misses where the value sits.

The malware is not really after your source code. It is after the identities your code uses to do its job: CI service accounts, registry publish tokens, cloud roles, and the API keys your applications present to AI services. These are non-human identities, and most organizations manage them far more loosely than they manage human accounts. Secrets land in environment variables, get written to dotfiles, and persist in CI configuration long after anyone remembers creating them. IronWorm is built to harvest exactly that sprawl.

The AI key targeting is the newer wrinkle. Provider keys for Anthropic, OpenAI, and similar services are now first-class credentials with real spend attached and, increasingly, access to internal data through connected tooling. A stolen key is no longer just a billing problem. It can be a path into whatever the agent or integration can reach. Treating AI provider keys with the same rigor as a database password is overdue, and IronWorm is a concrete reason to move it up the list.

This is significant because the trust model underneath modern development assumes machine identities behave predictably. A worm that steals those identities and then acts as them breaks that assumption at the registry level, where one publish event can reach thousands of downstream consumers.

What to actually do
#

None of the defenses are exotic. The gap is usually that they are off by default.

  • Turn off automatic install scripts and allowlist the few packages that genuinely need them. Set ignore-scripts=true in your .npmrc and run installs with --ignore-scripts in CI.
  • Pin dependencies with lockfiles and review changes to preinstall and postinstall hooks during dependency updates, not just changes to application code.
  • Scope and short-live every npm and CI token. Treat Trusted Publishing and OIDC tokens as identities with least privilege, not as a fire-and-forget convenience.
  • Move AI provider keys and cloud credentials out of environment variables and flat files into a secret manager, and restrict them by scope and source where the provider supports it. Rotate anything that may have been exposed.
  • Run builds in ephemeral runners with restricted network egress. Blocking outbound connections to unknown destinations, including Tor, would have cut this worm’s command and control.
  • Watch for unexpected publish events on packages you own and for backdated commits that do not match developer activity. Both are signals IronWorm leaves behind.
Quick win for this week: audit which of your dependencies actually run install scripts. Most do not need them. Setting ignore-scripts=true and allowlisting the handful that do removes the exact execution path IronWorm relied on, with almost no impact on normal workflows.

Where this leaves us
#

IronWorm is not a clever piece of malware so much as a clear statement about where the soft tissue is. The registry trusts the token. The pipeline trusts the package. The application trusts the key. Strip out the human, and the whole chain runs on identities that most teams provision once and rarely revisit.

The campaign got pulled within a day, but the pattern is not going anywhere. Self-propagation through trusted publishing rails is now a proven technique, and the next variant will assume your install scripts run and your secrets sit in plaintext. The teams that scoped their machine identities and locked down their build environments before this week are the ones who get to treat it as a Tuesday rather than an incident.

How are you handling publish-token scope and install-script policy in your pipelines right now? I am curious what is working in practice.

Juan Carlos Munera
Author
Juan Carlos Munera
Passionate about cybersecurity, governance, risk, and compliance. Sharing insights on security best practices, frameworks, and industry trends.

Related