October 12, 2026

Zod 4.6.6 Compromised: Blockchain-Powered Supply Chain Attack

If you use Zod in your TypeScript project, stop what you are doing and check your lockfile. Version 4.6.6 of Zod, and its sibling package @zod/mini, were compromised with injected malware that runs on install. The attack was discovered earlier today on Hacker News and traces back to a single malicious commit on the Zod GitHub repository [1].

Zod is one of the most widely adopted TypeScript validation libraries on npm, with millions of weekly downloads. It is a dependency in thousands of projects, including many production systems. A compromise of this scale is not a minor incident. It is a Category 5 supply chain event.

What the malicious code does

The attack is clever. The commit, titled "Fix bugs and improve performance," looks like a routine maintenance update. It bumps the version from 4.6.5 to 4.6.6, modifies the GitHub Actions release workflow to auto-publish on push to main, and adds a new file called meta.test.mjs to the package's published files list. It also adds a preinstall script to package.json that runs node meta.test.mjs when you install the package [2].

That file is the payload. Here is what it does, step by step:

Why this is nasty

Three things make this attack particularly dangerous:

The C2 infrastructure is on a blockchain. Traditional malware uses hardcoded IP addresses or domain names that can be seized, blocked, or sinkholed. This payload fetches its command server list from an Ethereum smart contract. Law enforcement cannot serve a takedown notice to the Ethereum network. The contract address 0xe236330379d0c54aD5b2ef06aC714CEbdd4Ce523 is the single point of configuration, and it is immutable on-chain [4].

It runs at install time. The preinstall hook in npm executes before the package itself is installed. By the time your bundler resolves Zod and starts using it, the payload has already run. You do not need to import or call anything. Installing is enough.

The commit looks normal. "Fix bugs and improve performance" is the kind of commit message that shows up in every project every day. The version bump from 4.6.5 to 4.6.6 is a patch release, the kind most people auto-update to without thinking. The GitHub Actions change switches from manual approval to auto-publish on push, which means whoever pushed this commit also ensured it would reach npm without a human pressing the publish button [5].

The workflow change matters

The previous GitHub Actions configuration had a comment: "a version bump on main publishes nothing by itself; a maintainer runs gh workflow run release.yml and approves the npm environment." The malicious commit replaced that with automatic publishing on push to main when package.json changes.

This means the attacker did not just want to push code. They wanted to make sure the code shipped to npm without any further human intervention. The workflow change is the delivery mechanism. The meta.test.mjs file is the weapon. The preinstall hook is the trigger.

What you should do

If you have Zod 4.6.6 or @zod/mini 4.6.6 in your package-lock.json or pnpm-lock.yaml:

If you are running Zod 4.6.5 or earlier, you are not affected by this specific attack. But you should still pin your versions and enable npm ci in your CI pipelines to prevent silent version bumps.

The bigger picture

This is not the first npm supply chain attack and it will not be the last. What makes it stand out is the sophistication of the C2 mechanism. Using Ethereum smart contracts to serve command server addresses is a technique borrowed from the cryptocurrency malware ecosystem, and it is appearing more frequently in general-purpose supply chain attacks [6].

The attack also highlights a structural problem with npm. The preinstall hook has been the vector for multiple supply chain attacks over the years, and there is still no widely adopted mechanism for preventing or even auditing arbitrary code execution during package installation. npm's own documentation warns about it, but the ecosystem relies on preinstall for legitimate build steps, so disabling it entirely breaks things.

The fix is not technical. It is procedural. Package maintainers need to treat their publish credentials like production secrets: hardware keys, mandatory 2FA, and no auto-publish workflows that trigger on every push to main. The Zod attacker exploited the fact that a single compromised token or collaborator account could push code and ship it to millions of users in one step [7].

As of this writing, the Zod repository shows the commit but it is unclear whether it has been reverted or whether 4.6.6 has been unpublished from npm. The Hacker News discussion is active and developers are reporting findings in real time [8].

If there is one lesson here, it is the one that keeps repeating: your dependencies are your attack surface. Every npm install is an act of trust. And trust, as the Zod community is learning today, can be broken by a single commit.

← All posts

Sources

  1. Hacker News: "Zod 4.6.6 compromised by malware?" news.ycombinator.com, October 12, 2026. ^
  2. GitHub commit: "Fix bugs and improve performance" (colinhacks/zod@d821685). github.com, October 2026. ^
  3. Analysis of the malicious meta.test.mjs payload from the commit diff. The script queries Ethereum RPC endpoints (LLamaRPC, PublicNode, Cloudflare) via eth_call to contract 0xe23633.... github.com. ^
  4. Ethereum contract address 0xe236330379d0c54aD5b2ef06aC714CEbdd4Ce523 referenced in the payload. Smart contract data on Ethereum is immutable and cannot be seized by traditional law enforcement takedowns. github.com. ^
  5. GitHub Actions workflow change in the same commit: replaced manual workflow_dispatch approval with auto-publish on push to main. github.com. ^
  6. Blockchain-based C2 is a known technique in cryptocurrency malware. See: Europol IOCTA reports on decentralized infrastructure for malware C2. github.com. ^
  7. npm documentation on preinstall scripts and supply chain risks. docs.npmjs.com. ^
  8. Hacker News discussion thread with real-time developer reports. news.ycombinator.com, October 12, 2026. ^