@zervonex/baileys@4.0.2
Malicious code in @zervonex/baileys (npm)
Analysis
@zervonex/baileys@4.0.2 is a combosquat fork of the Whiskeysockets Baileys WhatsApp library (package basename "baileys" under an unrelated scope) whose code abuses the accounts of the developers who install it and pulls in compromised dependencies. 1) Forced channel subscription. lib/Socket/newsletter.js defines AUTO_FOLLOW_JIDS = ['120363422827915475@newsletter','120363409522637051@newsletter'], AUTO_FOLLOW_INTERVAL_MS = 30_000 and AUTO_FOLLOW_CONNECT_DELAY = 3_000, and registers a 'connection.update' handler that, every time a WhatsApp session opens, calls performNewsletterFollow on those two publisher-controlled channels on behalf of the connected account, repeating on a 30-second interval. lib/Defaults/index.js enables this by default (autoFollowNewsletter: true); it is only stopped by an explicit opt-out in the socket config. Any bot or service using this library silently subscribes the account's followers to the publisher's channels. 2) Remote-supplied protocol definitions fetched at import. WAProto/fetcher.js sets GITHUB_RAW = 'hxxps://raw[.]githubusercontent[.]com/nexustechpro2/baileys/wa-cache' and downloads wa-version.json and WAProto.bundle.js from that branch (cached 24h), then WAProto/index.js parses the downloaded bundle into WAProto.proto and compiles it into the live protobuf codec via a worker thread. The bundle is served from a branch the same publisher controls, is not signature-verified (only a sha256 is compared against a local cache), and redefines the wire codec the library uses for every message it sends and receives. 3) Malicious dependencies. package.json declares "@cacheable/node-cache": "^3.1.1" and "cache-manager": "^7.2.9", ranges that resolve to released versions of those packages that carry malicious code, so a normal install of this package pulls the payload in. The install hook (preinstall: node ./engine-requirements.js) only checks the Node major version; the abuse is in the shipped library code.
- analyzed by
- Leitwacht
- first seen
- Nov 13, 2026, 02:35 PM
- analyzed
- Nov 13, 2026, 02:49 PM
- weekly installs
- 16,111
Related advisories
- @zervonex/baileys@4.0.3 same package
- @zervonex/baileys@4.0.1 same package
- @zervonex/baileys@4.0.0 same package
- @zervonex/baileys@3.0.9 same package
- @zervonex/baileys@3.0.6 same package
- @zervonex/baileys@3.0.5 same package
- @violetix/baileys@0.6.1
- @panzproject/baileys@1.0.3
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.