TL;DR: A single npm publisher has used typosquatted packages to pivot from credential and wallet theft to a DDoS botnet recruit, while keeping the same triple install-hook scaffold and publishing both payloads in parallel, according to Xygeni. The pattern shows why defenders need to hunt install-time behaviour and provenance, not just known malicious payload strings.
NHIMG editorial — based on content published by Xygeni: the PhantomBot npm typosquat campaign and its pivot from secrets theft to botnet recruitment
By the numbers:
- 17 minutes, redentials are exposed publicly, attackers attempt access within an average of 17 minutes , and as quickly as 9 minutes in some cases.
Questions worth separating out
Q: What breaks when malicious npm packages execute during CI/CD installs?
A: The main failure is that package installation becomes code execution inside a trusted build context.
Q: Why do typosquatted packages so often expose non-human identities?
A: Because developer workstations and CI runners usually hold SSH keys, cloud tokens, GitHub credentials, and environment variables that are valid outside the host.
Q: How do you know if package security controls are actually working?
A: Look for fewer unexpected publishes reaching build systems, lower rates of install-time outbound connections, and measurable reductions in secret exposure during pipeline execution.
Practitioner guidance
- Hunt for typosquat packages in lockfiles Search package-lock.json, yarn.lock, and pnpm-lock.yaml for axois-utils and chalk-tempalte, and expand the hunt to near-miss names that differ by one or two characters.
- Inspect install-time behaviour, not just payload hashes Flag packages that declare preinstall, install, and postinstall on the same script, or that import child_process, https, or tunnel-related code during installation.
- Rotate exposed secrets from developer hosts Assume credentials in process.env, ~/.ssh, ~/.aws, ~/.npmrc, and .env* files on affected hosts are compromised, then rotate and revoke them in the source systems.
What's in the full analysis
Xygeni's full analysis covers the operational detail this post intentionally leaves for the source:
- Line-by-line breakdowns of the malicious package files and lifecycle hooks that executed on install
- Indicators of compromise for the callback infrastructure, persistence artefacts, and package versions
- Operator-side details of the shipped C2 binary and source file that turn the tarball into a kit
- Full remediation guidance for Windows, Linux, and macOS persistence removal
👉 Read Xygeni's analysis of the PhantomBot npm typosquat campaign →
Typosquatted npm packages: what the install-hook pivot means?
Explore further
Install-hook abuse is now the durable attack surface in package ecosystems. The interesting part of this campaign is not the typo alone, but the repeated use of lifecycle hooks as the execution trigger. That makes the metadata layer, not the source code body, the real control point. Organisations that only inspect payload signatures are defending the wrong layer, because the install scaffold can deliver new malware families without changing the package’s trust profile. Practitioners should treat install-time behaviour as a governance signal, not a build detail.
A question worth separating out:
Q: Should organisations block reverse-tunnel services in development networks?
A: Yes, if those services are not needed for an explicit operational reason. Reverse tunnels are a common way to hide command-and-control traffic behind benign domains, and they weaken egress visibility. If a team must allow them, the allowance should be tightly scoped, logged, and reviewed against real business need.
👉 Read our full editorial: Typosquatted npm install hooks now swap secrets theft for botnets