@bottino/baileys (npm) · Malicious Code
Affects @bottino/baileysSource GCVE Database
Malicious package : remove @bottino/baileys and rotate any secrets on hosts that installed it.
Data as of 26 Oct 2026, 16:27 UTC
Malicious package
Published to npm · OSV MAL-2026-17351
What to do
Remove @bottino/baileys from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npm@bottino/baileys | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
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 (query_id 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: @bottino/baileys (npm), version(s): 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.9, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.2, 1.0.1. --- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (571d52cf3274d95d4824667269921b2e0ad1478fe9f324a74fab0ba377bb9a26) This fork of Baileys overrides `requestPairingCode` so that when the caller does not supply an explicit `pairKey`, `authState.creds.pairingCode` is set to the fixed literal string `BYPAKI64`. That value is then used as the KDF input for the WhatsApp companion-device link-code encryption via `derivePairingCodeKey(authState.creds.pairingCode, salt)`. Because the pairing code is a known constant baked into the package, anyone who knows the target phone number of the installer's WhatsApp account can complete the companion-device pair flow from a device they control and obtain persistent access to the installer's WhatsApp session (read/send messages, contacts, media) — a full account takeover backdoor against any application built on this library. Additionally, on socket connect the code auto-subscribes the installer's WhatsApp account to a hardcoded newsletter JID `120363418582531215@newsletter` and persists a `basedbysam` flag so the covert subscribe runs once per credential store; this covert action uses the installer's WhatsApp identity without disclosure.
References
- ox.security/blog/phantomsub-malicious-npm-campaign-secretly-adds-users-to-whatsapp-spam-channels/ (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.2 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.0 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.5 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.10 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.13 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.8 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.6 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.11 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.12 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.14 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.9 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.1 (opens in a new tab)
- npmjs.com/package/@bottino/baileys/v/1.0.7 (opens in a new tab)
- github.com/advisories/GHSA-qg7r-f2jp-2mmx (opens in a new tab)