Malicious npm Releases Hijack Trusted Pipeline to Steal WhatsApp Sessions and Secrets
Written by AI from the linked story. Not reviewed by an editor. How this works
Attackers compromised the WPPConnect project's own publishing pipeline to inject malicious code into two npm releases, meaning downstream users received trojanized packages through a channel they had every reason to trust. The malicious module exfiltrated environment variables, .env files, and WhatsApp session tokens to a Telegram bot the moment the library was imported, giving attackers immediate access to sensitive credentials. Release tags were later rewritten to hide the malicious commits, actively obstructing forensic investigation. This incident illustrates how a compromised CI/CD or publishing credential can turn a project's own trusted infrastructure into an attack vector against every consumer of that package. Organizations relying on open-source libraries without integrity verification or dependency pinning are especially exposed to this class of supply chain attack.
Tactical Insight
Immediate actions
- Audit all npm packages currently in use against known-good checksums and pin dependencies to verified, immutable versions (e.g., exact SHAs rather than version ranges)
- Rotate all environment variables, secrets, and session tokens that may have been loaded in environments where versions 2.4.1 or 2.10.82 were imported
- Remove or block the compromised package versions in your artifact repository or private registry
Long-term improvements
- Enforce cryptographic signing of all published packages and verify signatures in your build pipeline before consuming any dependency
- Protect publishing credentials with MFA and restrict pipeline tokens to the minimum permissions needed to publish, using short-lived OIDC tokens where possible
- Implement immutable artifact storage and Git tag protection so that release tags and published versions cannot be silently rewritten after the fact
Detection measures
- Deploy software composition analysis (SCA) tools that alert on new or unexpected outbound network connections initiated during package import or build steps
- Monitor CI/CD pipeline logs and npm audit feeds for unexpected new releases from trusted packages, and require human approval before automatically consuming updated versions in production