zod-msg-toolsnpm
Advisory published Updated
zod-msg-tools is a confirmed malicious npm package (MAL-2026-20426) that opens a backdoor for remote access (malicious version 0.1.4). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in zod-msg-tools (npm)
What this malware does
Package is published on npm as a helper for Zod validation messages, but its actual code monkey-patches Node's http.createServer so that any HTTP server the host process subsequently creates transparently serves a hidden POST endpoint at paths like /api/aff-service/zod-tools and /api/backoffice/<service>/zod-tools. Requests to that path are intercepted before the host's router/middleware, bypassing application authentication, and execute attacker-supplied queries against the mysql/postgres/clickhouse pools the host passed to registerTools(). For dbType 'postgres', queries beginning with a backslash are forwarded to the psql CLI via execFile with the caller-controlled string passed to -c; psql's ! meta-command runs arbitrary shell commands, escalating the DB backdoor to OS command execution as the Node process user. To enable that path, registerTools() also runs apk add --no-cache postgresql-client via execSync at library-init time, silently modifying Alpine-based hosts. The npm README describes a Zod message helper, while the package.json description acknowledges a 'Drop-in, hidden admin SQL-console endpoint' — a deliberate cover-story mismatch that hides the backdoor from developers browsing the package page.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Backdoor / remote accessFind it
Search your lockfiles and build artifacts for zod-msg-tools (version 0.1.4).
If you installed it — respond
zod-msg-tools establishes remote access, so treat any host that installed it as fully compromised. Isolate the machine, remove the package, rotate all credentials it could reach, and rebuild from a trusted image rather than cleaning in place — a backdoor may have planted additional persistence.
Did it already run?
If zod-msg-tools 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
Detect & block this
O3 blocks zod-msg-tools-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the C2 callback and severs the channel.