npm · Malicious package advisory
Malware@erlanzz/baileys
GHSA-pwrr-vrh9-c7gf
Malicious code in @erlanzz/baileys (npm)
Details
**Severity:** Critical **Affected versions:** `= 1.0.0` This package is a fork of the Baileys WhatsApp Web library (npm) and belongs to the "PhantomSub" family described by OX Security in September 2026: the publisher injected code that, without the installer asking, uses the installer's own authenticated WhatsApp session to subscribe that account to WhatsApp Channels (newsletters) the publisher chose, by sending the WhatsApp `w:mex` FOLLOW query (query_id 7871414976211147) for each target channel JID. `package/lib/Socket/newsletter.js` lines 47-65 (cited line 58: `QueryIds.FOLLOW`) define an array of three base64 strings and, 90 seconds after the newsletter socket is created, decode each with `Buffer.from(channel, "base64")` and send a FOLLOW query, 6 seconds apart. Decoded JIDs: `120363387182851100@newsletter`, `120363371199176376@newsletter` and `120363421367985094@newsletter`. There is no opt-out and the behavior is not documented. Line numbers refer to version 1.0.0. Static review of the published tarball(s) found no code that sends WhatsApp credentials or session keys off-host, no install-time payload (the only install hook is Baileys' stock Node.js version check in `engine-requirements.js`), and no persistence; the payload runs when an application creates a WhatsApp socket with the library. The harm is the covert use of the victim's account to inflate the publisher's channel subscribers. SHA-256 of the published npm tarball(s): 1.0.0: `9bc787ecc07e18d2504ab4e06e97d86d13a9952515a529a28b53a227d247b294`. --- Credit: [OpenSSF](https://github.com/ossf/malicious-packages) ([source](https://github.com/ossf/malicious-packages/blob/d69382a194448ad0562ad4d9e4380c1c6a673841/osv/malicious/npm/@erlanzz/baileys/MAL-2026-17440.json)) **References:** - https://github.com/ossf/malicious-packages/blob/d69382a194448ad0562ad4d9e4380c1c6a673841/osv/malicious/npm/@erlanzz/baileys/MAL-2026-17440.json - https://www.npmjs.com/package/@erlanzz/baileys - https://www.ox.security/blog/phantomsub-malicious-npm-campaign-secretly-adds-users-to-whatsapp-spam-channels - https://github.com/advisories/GHSA-pwrr-vrh9-c7gf
Compromised versions (1)
- = 1.0.0
Any computer that installed or ran a compromised version should be considered fully compromised. Rotate every secret on that machine from a clean environment.