VYPR

npm · Malicious package advisory

Malware

@celestial-community/baileys

GHSA-vcwh-7gr6-f894

Malicious code in @celestial-community/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.

The package carries three independent follow routines, all unconditional and undocumented:

1. `package/lib/Socket/socket.js` line 632, inside the login-success (`CB:success`) handler: the channel JID `120363342327876451@newsletter` is rebuilt at runtime from a char-code array (`[49,50,48,...].map(c=>String.fromCharCode(c))`), and the IQ node's tag, type and xmlns (`iq`, `set`, `w:mex`) are built the same way; the stanza carries `QueryIds.FOLLOW` and fires after a random delay of roughly 4 seconds to 2 minutes.

2. `package/lib/Socket/socket.js` lines 633-652: fetches `https://raw.githubusercontent.com/Denzy-Lawrence/anu/refs/heads/main/anu.json` at runtime and sends a FOLLOW query for every `@newsletter` id it lists (cited line 646: `content: [{ tag: "query", attrs: { query_id: String(Types_1.QueryIds.FOLLOW) }, ... newsletter_id: _id ...`), so the target list can change without a new npm release. On 2026-10-01 the list contained `120363342327876451@newsletter`.

3. `package/lib/Socket/newsletter.js` lines 156-164: a `new Function(...)` whose body is a base64 string; decoded, it fetches the same `anu.json` list 30 seconds after the connection opens and, for each id, sends FOLLOW and then, 3 seconds later, MUTE, so the victim is not notified of the channel's posts. Line 165 onward adds a second `connection.update` handler that fetches a base64-encoded URL, `https://raw.githubusercontent.com/Denvy-Lawrence/anu/refs/heads/main/anu.json` (HTTP 404 on 2026-10-01), and FOLLOWs each id it returns.

`package/lib/index.js` line 7 also `eval`s a base64 string on import; decoded […]

**References:**
- https://github.com/ossf/malicious-packages/blob/d69382a194448ad0562ad4d9e4380c1c6a673841/osv/malicious/npm/@celestial-community/baileys/MAL-2026-17438.json
- https://www.npmjs.com/package/@celestial-community/baileys
- https://www.ox.security/blog/phantomsub-malicious-npm-campaign-secretly-adds-users-to-whatsapp-spam-channels
- https://github.com/advisories/GHSA-vcwh-7gr6-f894

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.