cvelo
P2 · HighMalware

Malicious code in @dcloude/baileys (npm)

  • MAL-2026-20951

Description

Show the whole description

@dcloude/baileys is a modified copy of the Baileys WhatsApp Web library (@whiskeysockets/baileys) that silently subscribes the user's WhatsApp account to dozens of channels chosen by its author. When an application that imports it creates a socket with `makeWASocket`, `lib/Socket/newsletter.js` sends the newsletter FOLLOW query on the user's authenticated session for every channel ID in a hardcoded list: on the first connection in 0.0.8 to 0.1.2 (41 to 53 IDs from `DEFAULT_AUTO_FOLLOW_CHANNELS`), and 150 seconds after the socket is created in 0.1.3 and 0.1.4 (57 IDs, with no way to turn it off). The code comments call this a transparent auto-follow of "this library's own channel" documented in the README and a LITERACY.md file, but the README does not mention it and the package has no LITERACY.md, and a bundled "channel-follow guard" blocks other code's follow calls while allowing the author's list. package.json of @dcloude/baileys@0.1.3 declares its cryptography dependency as `"libsignal": "github:tenka-san/libsignal-node"` — a non-registry git source with no commit SHA, tag, or integrity hash. `npm install` therefore fetches whatever that repository's default branch contains at install time and executes any lifecycle scripts it carries, so the content installed and run on the installer's machine can change after publication without any new version of this package. Separately, lib/Socket/newsletter.js defines a module-level list of roughly 57 hardcoded `@newsletter` JIDs and a timer that fires about 150 seconds after the socket layer is constructed, issuing the FOLLOW mex mutation for each JID using the installer's authenticated WhatsApp session. This behavior is not part of the advertised API and is not documented in the README; it uses the installer's account identity to pad reach for author-chosen channels. No credential reads, exfiltration endpoints, or obfuscated payloads are present in the shipped source.

Text from the OSV record.

Affected

  • @dcloude/baileysnpm

    • No versions listed

Timeline

  1. Published

Related news

No article from the followed outlets names this vulnerability.