MAL-2026-17394: Malicious code in kasabaileys (npm)
This package is part of a large family (100+ identified as of September 2026) of near-identical forks of the Baileys WhatsApp Web library that inject a covert channel-subscription action into the WhatsApp socket layer. On connect, the injected code issues an authenticated w:mex FOLLOW query (queryid 7871414976211147) against one or more attacker-chosen WhatsApp Channel/Newsletter JIDs, using the installer's own authenticated WhatsApp session -- silently subscribing the victim's account to channels it never asked to join.
The target JID(s) are hidden from casual source review via one of several obfuscation techniques observed across the family: a plain string literal, base64 encoding, base64+XOR, or a char-code array reconstructed at runtime. Some variants instead fetch a mutable, attacker-controlled remote JSON/JS list of target JIDs from GitHub or another host at runtime, letting the target list change after installation without a new npm publish. Every sample in the family shares the same underlying mechanism (a wrapped/patched socket-connect routine that fires the FOLLOW query some seconds after connect), even though the package name, JID value(s), and obfuscation/delivery method differ per fork.
The malicious action abuses the installer's own authenticated WhatsApp session to gain reach and subscribers for attacker-controlled channels; it does not exfiltrate credentials, establish persistence, or execute arbitrary remote code.
Affected package: kasabaileys (npm), version(s): 1.0.2, 1.0.1, 1.0.0, 0.3.15.
--- -= Per source details. Do not edit below this line.=-
Source: ghsa-malware (d37017e64a3cc849ef083cc69e78e783a86b830ffc3e4bf1fe308742d8316548) 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Remove
Remove
npm/kasabaileysfrom your environment.Remove the package; removing it may not remove all malicious software resulting from its installation.
- Operational
Immediately rotate all secrets and keys stored on the affected computer, using a different computer.
Event History
Frequently Asked Questions
Which deployments are exposed to the unauthorized channel subscriptions?
Deployments are exposed when they use this package to establish a WhatsApp socket connection with an authenticated WhatsApp session. The FOLLOW query is issued after connection using that authenticated session.
What access does an attacker need to cause the action?
The malicious behavior is embedded in the package's patched or wrapped socket-connect routine. It does not require the attacker to separately authenticate to the victim's WhatsApp account; the installed package uses the installer's existing authenticated session.
How can teams check whether this behavior is present?
Inspect the socket-connect path for a delayed authenticated w:mex FOLLOW query, including query_id 7871414976211147. Target Channel/Newsletter JIDs may appear as plain text, base64-encoded data, base64 plus XOR, runtime-reconstructed character codes, or values fetched from a remote JSON or JavaScript list.
Why might a source review at installation time be insufficient?
Some variants retrieve the target JID list from an attacker-controlled remote location at runtime. That allows the targets to change after installation without a new npm publication.