A recent change in the zod repository upgrades package versions to 4.6.6 and injects a new file meta.test.mjs into both @zod/mini and zod packages, then adds a "preinstall": "node meta.test.mjs" hook to package.json and includes that file in published files. The release workflow and version constant were updated to publish 4.6.6. The patch modifies nine files (including pnpm lock updates) and explicitly makes the meta.test.mjs part of the package payload that runs during npm install.
The injected meta.test.mjs contains obfuscated code that queries multiple Ethereum RPC endpoints using eth_call against a hardcoded contract/address and calldata, decodes results into domain names, fetches a JSON "loader" from those domains, writes a payload file to a temporary directory, sets RUNTIME_DIR, and executes a base64-encoded setup via dynamic import("data:text/javascript;base64,..."), then attempts to remove the temp files. This sequence results in remote code execution during npm install and persistent runtime setup. Do not install version 4.6.6; treat any installs of 4.6.6 as compromised and revert to a prior safe version until the repository is audited and the malicious preinstall removed.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.