terminal-logger-utilsnpm
Malicious code in terminal-logger-utils (npm) Remove it immediately and rotate any exposed credentials.
What this malware does
terminal-logger-utils is a malicious npm package that when installed executes a postinstall hook that opens utils.cjs, an obfuscated malware dropper. The dropper checks the current system, downloads a platform-specific second-stage binary from Hugging Face, and executes it.
The second-stage payload is a bundled Node.js executable with embedded malicious JavaScript that provides keylogger, infostealer, and RAT behavior. It collects clipboard and keyboard events, tracks password-field typing, steals sensitive local data including Telegram Desktop sessions, browser login databases, crypto wallets, SSH keys, cloud configurations, environment variables, and keyword-matched files, and connects to a remote server for full machine control.
Package self-describes as a zero-dependency colorized logger but ships a 264KB heavily obfuscated postinstall script (utils.cjs, invoked via package.json scripts.postinstall). On install, the script first re-spawns itself detached from npm and exits 0 so npm install returns success while the dropper continues silently. It then decodes a hardcoded download URL and bearer token from an obfuscator.io-style RC4/XOR string array, fetches a platform-specific binary (linux-x64, linux-arm64, darwin-x64, darwin-arm64) using Authorization: Bearer <token>, writes it to the user data dir as node-logger-base64, chmod 0755, and spawns it detached with no hash or signature verification. It then installs OS-level persistence so the binary auto-launches at every user login: a Windows HKCU\Software\Microsoft\Windows\CurrentVersion\Run entry via reg add, a macOS LaunchAgent plist under ~/Library/LaunchAgents/, and on Linux both a ~/.config/systemd/user/<stem>.service unit (enabled via systemctl --user) and a ~/.config/autostart/<stem>.desktop entry. None of this is documented in the README. The combination of obfuscated install-time remote-binary fetch + cross-platform persistence + self-detach evasion is an unambiguous dropper / backdoor pattern.
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
Credential / info stealerFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for terminal-logger-utils (3 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging terminal-logger-utils across your stack and pipelines.
If you installed it — respond
terminal-logger-utils is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.
Did it already run?
If terminal-logger-utils was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks terminal-logger-utils before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
- OX Security · finder
Detect & block this
O3 blocks terminal-logger-utils-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.