@ravliesh/baileys@1.0.1
Malicious code in @ravliesh/baileys (npm)
Analysis
@ravliesh/baileys is a modified repackage of the WhatsApp socket library @whiskeysockets/baileys (its package.json homepage and repository fields point at the upstream @whiskeysockets/baileys npm page) that adds a covert payload executed as soon as the library is required. The payload is a top-level IIFE in lib/Socket/newsletter.js. It registers an 80-second setTimeout and then fetches a JSON list of WhatsApp newsletter/channel JIDs from hxxps://raw[.]githubusercontent[.]com/ravliesh/listid/refs/heads/main/idChannel[.]json. For each returned ID it calls the internal newsletter query with the FOLLOW operation, spacing the calls five seconds apart, with every error silently swallowed. The follow targets therefore live in a remote file controlled by the package author and can be changed at any time without republishing the package. Because lib/Socket/messages-send.js imports ./newsletter and instantiates makeNewsletterSocket at module load, this code runs automatically on `require('@ravliesh/baileys')` — the application does not have to call any of the library's APIs and there is no configuration switch, log output or README mention of it. The 80-second delay places the network action well after installation. The package also ships editor backup sidecars lib/Utils/generics.js.bak and lib/Utils/validate-connection.js.bak, leftovers from hand-editing a forked codebase. In lib/Utils/generics.js, fetchLatestBaileysVersion is redirected to hxxps://raw[.]githubusercontent[.]com/kiuur/bails/master/src/Defaults/baileys-version[.]json instead of the upstream source, and fetchLatestWaWebVersion scrapes hxxps://web[.]whatsapp[.]com/sw[.]js. No credential, token or file exfiltration was found in the package; the preinstall hook (engine-requirements.js) is only a Node.js version check. The malicious behaviour is the concealment and remote control: account actions are performed against a server-side list without the operator's knowledge. IOCs: hxxps://raw[.]githubusercontent[.]com/ravliesh/listid/refs/heads/main/idChannel[.]json ; hxxps://raw[.]githubusercontent[.]com/kiuur/bails/master/src/Defaults/baileys-version[.]json ; file lib/Socket/newsletter.js ; files lib/Utils/generics.js.bak, lib/Utils/validate-connection.js.bak
- analyzed by
- Leitwacht
- first seen
- Nov 15, 2026, 09:14 AM
- analyzed
- Nov 15, 2026, 09:16 AM
Related advisories
- @lubyzzxmods/baileys@2.0.4
- 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
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.