lotusbail
Lotusbail is a malicious npm package (trojanized dependency) masquerading as a WhatsApp Web API library and presented as a fork/wrapper of the legitimate Baileys / @whiskeysockets/baileys project. It was available on npm for roughly six months (uploaded May 2025) and accumulated >56,000 downloads. The package provides real WhatsApp integration functionality to evade suspicion and static/reputation-based detection.
Capabilities and behavior (as described):
- Credential/data theft from WhatsApp Web API usage: intercepts WhatsApp authentication tokens/credentials, session keys, message history (sent/received), contacts, and media/documents by wrapping the legitimate WebSocket client and duplicating data flows.
- Exfiltration: stolen data is encrypted with a custom RSA implementation prior to transmission; the exfiltration destination/server details are heavily obfuscated (reported techniques include Unicode variable manipulation, LZString compression, Base-91 encoding, and AES-encrypted configuration strings).
- Account takeover/persistence: hijacks WhatsApp multi-device pairing by using a hardcoded (AES-encrypted) pairing code to silently link an attacker-controlled device to the victim’s WhatsApp account, granting full access (read/send messages, download media, access contacts). This access persists even after the package is uninstalled/removed unless the victim manually unlinks the rogue device in WhatsApp settings.
- Anti-analysis/anti-debugging: includes 27 anti-analysis traps (e.g., infinite loops) and freezes execution when debuggers/sandboxes are detected.
Infection vector / targeting:
- Supply-chain attack via the npm ecosystem, targeting developers and environments that install/use the package as a WhatsApp API dependency.
Attribution / reporting:
- Discovered and reported by Koi Security (including researchers Tuval Admoni and Idan Dardikman). No specific threat actor attribution is provided in the content.
Known indicators of compromise:
- The content does not provide specific domains/IPs/URLs for the exfiltration infrastructure; it only states that seed phrases/tokens/data were exfiltrated to attacker-controlled infrastructure with server details obfuscated.
Techniques & procedures
9 distinct techniques documented for this family, organized by ATT&CK tactic.
Initial Access
1 technique
Initial Access
"The lotusbail npm package presents itself as a WhatsApp Web API library - a fork of the legitimate @whiskeysockets/baileys package... Behind that working functionality: sophisticated malware..."
Persistence
1 technique
Persistence
"The malware hijacks this process with a hardcoded pairing code... linking the threat actor's device... persistent access... uninstalling... device stays linked"
Privilege Escalation
1 technique
Privilege Escalation
"The malware hijacks this process with a hardcoded pairing code... linking the threat actor's device... persistent access... uninstalling... device stays linked"
Stealth
2 techniques
Stealth
"The exfiltration server URL is buried in encrypted configuration strings... four layers of obfuscation: Unicode variable manipulation, LZString compression, Base-91 encoding, and AES encryption."
"The package includes 27 infinite loop traps that freeze execution if debugging tools are detected... detect sandbox environments"
Credential Access
3 techniques
Credential Access
"When messages arrive, it intercepts them. When you send messages, it records them."
"When you authenticate, the wrapper captures your credentials... Authentication tokens and session keys"
"The package wraps the legitimate WebSocket client that communicates with WhatsApp. Every message... passes through the malware's socket wrapper first."
Discovery
1 technique
Discovery
"The package includes 27 infinite loop traps that freeze execution if debugging tools are detected... detect sandbox environments"
Collection
3 techniques
Collection
"When messages arrive, it intercepts them. When you send messages, it records them."
"Complete message history (past and present) Full contact lists with phone numbers Media files and documents"
"The package wraps the legitimate WebSocket client that communicates with WhatsApp. Every message... passes through the malware's socket wrapper first."
Exfiltration
1 technique
Exfiltration
"...prepared for exfiltration... includes a complete, custom RSA implementation for encrypting the data before transmission"
Recent activity
10 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.