# Zod 4.6.6 ships a preinstall script that pulls a payload from an Ethereum contract

Original title: Zod 4.6.6 compromised by malware?

> Hacker News story 50052814 · language: en · submitted 2026-10-12
> Web version: https://zeli.app/story/50052814
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 181 · by [luggage_bazooka](<https://news.ycombinator.com/user?id=luggage_bazooka>) · 💬 52
[original](<https://github.com/colinhacks/zod/commit/d821685ea6732436fcdf786a81d076958471e467>) · [HN discussion](<https://news.ycombinator.com/item?id=50052814>)

## Summary

The Zod 4.6.6 release adds a preinstall hook that runs meta.test.mjs, which queries an Ethereum contract via public RPC endpoints to retrieve a list of domains, fetches a base64-encoded setup script from one of them, and executes it. The commit also changes the release workflow to publish automatically on pushes to main that modify package.json.

## Key quote

> const C="0xe236330379d0c54aD5b2ef06aC714CEbdd4Ce523",S="0x53ed5143",R=["https://eth.llamarpc.com","https://ethereum-rpc.publicnode.com","https://cloudflare-eth.com"];

## HN discussion (52 comments)

### [jaynetics](<https://news.ycombinator.com/item?id=50053253>)

> The compromised code wasn't actually released. This write-up has a lot of information:
>
> https://github.com/orgs/community/discussions/208477

### [yuvalkarmi](<https://news.ycombinator.com/item?id=50053402>)

> This is 3 weeks back, folks. It WAS real repository compromise - it made it to Zod's main, but not to npm.
>
> On September 21, someone used Colin's git credentials to push this compromised code into the project, Colin caught it, and reverted it that same day (PR #6620). He subsequently did release 4.6.6 on October 11, but it did NOT contain the infected code.
>
> Btw, Zod wasn't the only package targeted - same attack was attempted against standard-schema and nub. Nub DID make it to npm, but npm's malware scanning blocked it.
>
> Looks like a legit (well, illegitimate) attempted supply-chain attack, but no actual Zod release was compromised.

### [luggage_bazooka](<https://news.ycombinator.com/item?id=50052815>)

> The most recent version 4.6.6 has a very interesting commit (d821685) "Fix bugs and improve performance", that contain the following changes https://github.com/colinhacks/zod/commit/d821685ea6732436fcd...
>
> I didn't study what packages/mini/meta.test.mjs is doing in particular but it's not looking great

### [jaapz](<https://news.ycombinator.com/item?id=50053202>)

> Might is pretty tame, it is infected - EDIT: title was changed, it said "might be infected".
>
> The malware seems to inject some JS payload to execute when zod is installed, by fetching it from an ethereum smart contract (if I understand it correctly).
>
> Don't forget to flag the version on npm.
>
> EDIT: looks like the update never got on NPM: https://news.ycombinator.com/item?id=50053253

### [xx_ns](<https://news.ycombinator.com/item?id=50053239>)

> Interestingly, they added the `preinstall` key (that is supposed to run the malicious script when installed) under the package.json root, and not under `scripts`, so from what I can tell this wouldn't run on install.
>
> Otherwise, yeah, this seems like a stage-1 loader for fetching and running a payload off the Ethereum mainnet.

---

## Cite

- Page: https://zeli.app/story/50052814
- Date: 2026-10-12
- Source: github.com (https://github.com/colinhacks/zod/commit/d821685ea6732436fcdf786a81d076958471e467)
- Hacker News: https://news.ycombinator.com/item?id=50052814

## Other languages

- zh: https://zeli.app/zh/story/50052814 · markdown: https://zeli.app/zh/story/50052814.md
- ja: https://zeli.app/ja/story/50052814 · markdown: https://zeli.app/ja/story/50052814.md
- ko: https://zeli.app/ko/story/50052814 · markdown: https://zeli.app/ko/story/50052814.md
- de: https://zeli.app/de/story/50052814 · markdown: https://zeli.app/de/story/50052814.md
- es: https://zeli.app/es/story/50052814 · markdown: https://zeli.app/es/story/50052814.md
- ru: https://zeli.app/ru/story/50052814 · markdown: https://zeli.app/ru/story/50052814.md
