spencer-baileys@1.0.6
Malicious code in spencer-baileys (npm)
Analysis
spencer-baileys@1.0.6 is a trojanized clone of the Baileys WhatsApp Web API library that fetches an attacker-controlled instruction list and carries it out on the operator's authenticated WhatsApp session without the operator's knowledge. In lib/Socket/newsletter.js, makeNewsletterSocket() schedules setTimeout(..., 90000) and then calls runAutoSync(), which re-arms itself with setInterval(runAutoSync, 3 * 60 * 60 * 1000) — a comment in the code calls this "Recurring sync every 3 hours (Anti-Leave)". runAutoSync requires node-fetch and requests a URL hidden as a base64 literal, decoded at runtime with Buffer.from("aHR0cHM6Ly9zYXZhZ2UtcHJveC5vbnJlbmRlci5jb20vYXBpL3YxL2xpbmtz", 'base64').toString(), resolving to hxxps://savage-prox[.]onrender[.]com/api/v1/links. The JSON returned by that server is executed as a command list: - data.groups: each value is passed to sock.groupAcceptInvite(), silently joining the logged-in bot account to attacker-chosen WhatsApp groups. - data.channels: each value is resolved to a newsletter JID if required and then followed by sending a WhatsApp "w:mex" IQ to s[.]whatsapp[.]net with query_id 7871414976211147, subscribing the victim's account to attacker-chosen channels. Every step is wrapped in empty catch blocks and spaced 3 seconds apart, and the routine is deferred past process start, so the actions leave no error output: whoever runs this library's client is made to join groups and follow channels chosen by a third party. The tarball also ships a superseded copy of the same routine at lib/Socket/newsletter.js.bak.1790234479, using a 90,000 ms setTimeout and a different feed: the base64 literal aHR0cHM6Ly9maWxlcy5naWZ0ZWQuY28ua2UvZmlsZS9jaEppZHMuanNvbg== decodes to hxxps://files[.]gifted[.]co[.]ke/file/chJids[.]json, consumed as an array of newsletter JIDs that the client is made to follow via the same w:mex query_id 7871414976211147 request. Indicators: savage-prox[.]onrender[.]com /api/v1/links; files[.]gifted[.]co.ke /file/chJids.json; base64 payload aHR0cHM6Ly9zYXZhZ2UtcHJveC5vbnJlbmRlci5jb20vYXBpL3YxL2xpbmtz in lib/Socket/newsletter.js; base64 payload aHR0cHM6Ly9maWxlcy5naWZ0ZWQuY28ua2UvZmlsZS9jaEppZHMuanNvbg== in lib/Socket/newsletter.js.bak.1790234479; WhatsApp w:mex query_id 7871414976211147.
- analyzed by
- Leitwacht
- first seen
- Nov 15, 2026, 11:47 AM
- analyzed
- Nov 15, 2026, 11:48 AM
- weekly installs
- 330
Related advisories
- @jiancodes/baileys@2.0.6
- @ravliesh/baileys@1.0.1
- @lubyzzxmods/baileys@2.0.4
- dct-baileys@1.0.1
- @dinzid/bailstaov1@0.1.0
- baileyssteam@7.0.0
- @dinzid/bailstao@0.0.7
- amanexfujimiya-baileys@8.6.26
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.