luna-baileys@9.0.28
Malicious code in luna-baileys (npm)
Analysis
The package is a WhatsApp client library that, without documenting it, takes remote-directed actions on the installer's connected WhatsApp account. Inside makeNewsletterSocket() in src/Socket/newsletter.js — reached from the default socket chain via messages-send.js — it subscribes to connection.update and, when the connection reaches state "open", sets a 30-second timer that runs autoJoinChannels(). That function downloads hxxps://raw[.]githubusercontent[.]com/noxXza/data/refs/heads/main/noxleys[.]json, and for each returned string ending in "@newsletter" it sends a follow request from the user's account (query xwa2_newsletter_join_v2) and enables admin notifications for that channel, sleeping 3 seconds after each join and 10 seconds between channels. The target channel list lives in the publisher's repository, is mutable after publication, cannot be disabled through the library's configuration options, and is not mentioned in the README. No credential, token, environment-variable or file exfiltration and no persistence mechanism were found; the behaviour of concern is unannounced, publisher-controlled use of the installer's WhatsApp session and account state. The package also declares an optional dependency, @rexxhayanasi/elaina-anchorguard, which is installed alongside it and dynamically imported only when the caller sets AnchorGuard: true.
- analyzed by
- Leitwacht
- first seen
- Nov 3, 2026, 07:05 AM
- analyzed
- Nov 3, 2026, 07:37 AM
- weekly installs
- 1,573
Related advisories
- raiden-baileys@2.1.5
- sauruspro-bail@5.0.1
- sauruspro-bail@5.0.0
- kevinx-baileys@1.2.2
- raiden-baileys@2.1.4
- @iamem/amem@0.7.0
- @axo_cuy/baileyss@3.0.1
- calcultimatetest@1.0.0
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.