fast-baileys@2.0.9
Malicious code in fast-baileys (npm)
Analysis
fast-baileys@2.0.9, a WhatsApp Web (Baileys-style) client library, contains a concealed remote-command routine in lib/Socket/newsletter.js. The module's socket factory — invoked for every connection the library makes — installs a bare setTimeout that fires 90 seconds after startup with no returned handle, so it runs silently in the background of any application that uses the library and keeps the process alive. When the timer fires, the code requires node-fetch and downloads a URL that is stored base64-encoded so it does not appear in plaintext in the source: Buffer.from("aHR0cHM6Ly9kZXctbWQtZGF0YS5wYWdlcy5kZXYvY2hhbm5lbC5qc29u","base64").toString() resolves to hxxps://dew-md-data[.]pages[.]dev/channel[.]json. The JSON response is treated as a list of newsletter (channel) identifiers, and the code iterates it, sleeping three seconds between entries, issuing a WhatsApp IQ query (tag "iq", type "get", xmlns "w:mex", to s[.]whatsapp[.]net) with query_id 7871414976211147 and {variables:{newsletter_id:<jid>}} — the same query used by the library's newsletterFollow function. In effect the package makes the victim's authenticated WhatsApp session follow an arbitrary, publisher-controlled list of channels. Every error is swallowed by empty catch blocks, the block has no caller, no return value and no relation to the rest of the file, and no upstream Baileys source contains it. The remote list can be re-pointed at any time by whoever controls the Cloudflare Pages site, so the behaviour is a remote-instruction channel embedded in a library rather than a fixed feature: mass forced follows (engagement inflation) and a strong WhatsApp account-ban risk for operators who install the package as a drop-in Baileys replacement. A second, lower-risk data fetch exists in lib/Utils/generics.js, where fetchLatestBaileysVersion pulls version JSON from a third-party GitHub fork (raw[.]githubusercontent[.]com/mauricegift/gifted-aileys) rather than the upstream project. No credential, token, environment-variable, wallet or file exfiltration was found in the tarball, and the package declares no install or postinstall hook and no bin entries. IOCs: hxxps://dew-md-data[.]pages[.]dev/channel[.]json; base64 blob aHR0cHM6Ly9kZXctbWQtZGF0YS5wYWdlcy5kZXYvY2hhbm5lbC5qc29u; WhatsApp query_id 7871414976211147; delay 90000 ms; follow interval 3000 ms; hxxps://raw[.]githubusercontent[.]com/mauricegift/gifted-aileys/main/lib/Defaults/baileys-version[.]json.
- analyzed by
- Leitwacht
- first seen
- Nov 26, 2026, 05:51 PM
- analyzed
- Nov 26, 2026, 05:52 PM
- weekly installs
- 615
hxxps://github[.]com/dew-coders/fast-baileys Request takedown / dispute →Related advisories
- fast-baileys@2.0.8 same package
- sanka-baileyss@2.6.5
- clamp4js@1.0.9
- clamp4js@1.0.5
- cop3-rc@5.0.6
- cop3-rc@5.0.5
- sanka-baileyss@2.6.4
- sanka-baileyss@2.6.2
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.