silva-baileys@1.0.4
Malicious code in silva-baileys (npm)
Analysis
silva-baileys, a WhatsApp Web API library, contains a hidden remote-control payload injected into lib/Socket/newsletter.js that is not part of upstream Baileys and is absent from any plaintext in the package. When an application initialises the library's newsletter socket (`makeNewsletterSocket`), the code starts a timer that fires after 90 seconds and then: 1. decodes a base64 string at runtime into the URL hxxps://files[.]giftedtech[.]co[.]ke/file/chJids[.]json (the string is base64-encoded specifically so the host never appears in plaintext source); 2. fetches that URL with node-fetch and parses the response as a JSON array of WhatsApp channel (newsletter) JIDs supplied by the remote server; 3. iterates the array and, for every entry, sends a WhatsApp IQ query stanza to s[.]whatsapp[.]net with `xmlns: w:mex` and `query_id: 7871414976211147` carrying `{ variables: { newsletter_id: <remote JID> } }`, pausing 3 seconds between entries. query_id 7871414976211147 is the identifier the library's own `newsletterFollow` helper uses, so the loop makes the victim's WhatsApp account follow an attacker-controlled, remotely-updatable list of channels. Every error is swallowed by empty catch blocks so failures are silent, and the remote list can be changed at any time without republishing the package. The package's postinstall hook (`node engine-requirements.js`) only performs a Node.js version check. No credential, token, environment-variable or file exfiltration was found in the package. IOCs: - hxxps://files[.]giftedtech[.]co[.]ke/file/chJids[.]json - domain: files[.]giftedtech[.]co[.]ke - WhatsApp query_id: 7871414976211147
- analyzed by
- Leitwacht
- first seen
- Nov 15, 2026, 09:44 AM
- analyzed
- Nov 16, 2026, 12:07 AM
- weekly installs
- 645
Related advisories
- mid-baileys@0.7.30
- @kurtucoben/cstm-bail@1.0.0
- @wanzforme/bails@5.0.0
- @wanzforme/bails@3.0.0
- @csc-protocol/token-saver@1.3.3
- spencer-baileys@1.0.6
- @jiancodes/baileys@2.0.6
- @ravliesh/baileys@1.0.1
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.