Malicious code in @mrlegendbot/baileys (npm)
Description
@mrlegendbot/baileys is a fork of the WhatsApp Web library @whiskeysockets/baileys that silently makes the victim account follow attacker-chosen WhatsApp newsletter channels. lib/Socket/newsletter.js adds a startAutoFeatures() function (line 230) that is scheduled with setTimeout(() => startAutoFeatures(fullSock), 0) at socket construction (line 255), unconditionally and with no API surface exposing it. It fetches raw.githubusercontent.com/
CyberXYZ read every other published version statically on 2026-10-30 and 2026-11-01 (nothing was executed); with them, every published version is listed. All schedule the same startAutoFeatures() at socket creation and fetch the same Chids.json list. 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.2.3, 1.2.6 and 1.2.7 share a reformatted lib/Socket/newsletter.js (sha256 a8033938993216b828e06e57e8b78f75ff10e11ee331b4345676f40f6a40a1f4): 5 seconds after the socket is created it fetches the list and calls newsletterFollow(id) for each entry, 10 seconds apart, swallowing errors and without telling the user. 7.0.0-rc14 (sha256 2a45802b3e137ea232c3e14f84c2793b90bc937e3cfc47ab6407d0cdea06bdc1) and 1.0.0 (sha256 1ea8a7d706ce86cfe78ccec66b20c10d37f68163a146ce1deb95940c6cfdd3ac) do the same and, before following, also make the account react to the channels' last 50 posts and to each new post (enableAutoReaction, reactToAllNewMessages).
--- -= Per source details. Do not edit below this line.=-
Source: ghsa-malware (f86f02d1a202104ae56b2ace5afafe722f2b7f92e305fe586d45bd253298780e)
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.