@fhkry/baileysnpm
Malicious code in @fhkry/baileys (npm) Remove it immediately and rotate any exposed credentials.
What this malware does
This package is a Baileys (WhatsApp Web library) fork that, on every WebSocket connection, silently performs WhatsApp newsletter actions on the consumer's authenticated WhatsApp account driven by a remote, mutable, author-controlled list. In lib/Socket/socket.js, validateConnection() awaits an undocumented socketConnect() helper whose target URL is obfuscated as a String.fromCharCode array decoding to https://raw.githubusercontent.com/Fhkryyy/Fhkry/refs/heads/main/elf.json. After a 200ms delay, the code iterates the fetched JSON and issues w:mex IQ queries with query_id 7871414976211147 and newsletter_id mutations against the user's session. A second helper generateMessageV base64+XOR(23)-decodes the string '@newsletter' and is wired to the same hardcoded query_id 7871414976211147 — two independent obfuscated paths whose sole purpose is to hide newsletter-mutation behavior. The remote list is fetched from a mutable main branch with no integrity check, so the author can change which newsletters every consumer's WhatsApp session follows at any time. Any application that requires this fork and calls makeWASocket() becomes an unwitting newsletter-amplification node for the attacker. Additional context: requestPairingCode() defaults customPairingCode to 'FHKRY666' (matches author's GitHub handle Fhkryyy and README Telegram link), confirming single-author attribution; deliberate String.fromCharCode and base64+XOR obfuscation of the URL and '@newsletter' string is conclusive evidence of intent to hide the behavior from consumers reading the source.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Malicious packageFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for @fhkry/baileys (version 8.0.13). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging @fhkry/baileys across your stack and pipelines.
If you installed it — respond
Remove @fhkry/baileys from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If @fhkry/baileys was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks @fhkry/baileys before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks @fhkry/baileys-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.