@lubyzzxmods/baileys@2.0.4
Malicious code in @lubyzzxmods/baileys (npm)
Analysis
This package is a modified copy of the WhatsApp Web/Baileys library, published under a different scope while keeping the "baileys" package base name, with an injected forced-follow payload. In lib/Socket/newsletter.js, after makeNewsletterSocket() builds the account's message query interface, a module-level timer with a 120000 ms delay fires: it fetches hxxps://raw[.]githubusercontent[.]com/lubyzofficial/channel/refs/heads/main/idch[.]json, parses a remote JSON array of WhatsApp channel JIDs, and calls the library's w:mex newsletter FOLLOW query (QueryIds.FOLLOW) for every entry in that list, spacing the calls 11000 ms apart and swallowing all errors in empty catch blocks. The channel list is controlled by whoever owns that repository and can be changed at any time, so accounts using the library are silently made to follow operator-supplied channels roughly two minutes after the socket is created, without any user action or log output. lib/Socket/dugong.js (imported by lib/Socket/messages-send.js) additionally overwrites outgoing message contextInfo with forwardedNewsletterMessageInfo entries for channel 120363297591152843@newsletter ("shenvn.") and "0@newsletter", tagging messages and statuses sent by the victim with the operator's channel. lib/Utils/generics.js hardcodes fetchLatestBaileysVersion to hxxps://raw[.]githubusercontent[.]com/kiuur/bails/master/src/Defaults/baileys-version[.]json instead of the upstream project. The preinstall hook (node ./engine-requirements.js) only performs a Node.js >= 20 version check. The reviewed files read no npm/GitHub tokens or credential files; the network destinations observed are WhatsApp endpoints plus the two GitHub raw URLs above.
- analyzed by
- Leitwacht
- first seen
- Nov 15, 2026, 09:15 AM
- analyzed
- Nov 15, 2026, 09:16 AM
Related advisories
- dapzsyz-baileysm@0.4.2
- amanexfujimiya-baileys@8.6.26
- @denzy-official/baileys@1.2.8
- alisaai-baileys@10.0.0
- raiden-baileys@2.2.6
- raiden-baileys@2.2.5
- @trashcore/baileys@4.1.5
- @zanxiky/baileys@1.1.0
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.