Malicious code in @sanzoffc/baileys (npm)
Description
The @sanzoffc/baileys npm package is a malicious fork of the Baileys WhatsApp library that performs covert remote-controlled actions using the installer's authenticated WhatsApp session. It fetches a JSON list from a third-party controlled GitHub branch and issues WhatsApp GraphQL mutations to subscribe or follow newsletter IDs without user consent. The package uses obfuscated strings and hardcoded identifiers to evade detection. This behavior is undocumented and non-configurable, indicating malicious intent. The package pins most dependencies loosely, increasing risk. Installation of this package compromises the host system, potentially exposing all stored secrets and keys.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This malicious package is a fork of the Baileys WhatsApp library that injects covert remote-controlled behavior triggered on every WebSocket connection. It reconstructs a URL from obfuscated character codes to fetch a JSON list from a mutable GitHub branch controlled by a third party. For each ID in this list, it issues WhatsApp GraphQL mutations to subscribe or follow newsletters using the installer's authenticated WhatsApp session. Additionally, it decodes a hardcoded '@newsletter' JID and schedules a similar subscription action after a delay. The obfuscation and undocumented nature of these actions indicate deliberate evasion of detection. The package also declares an unpinned GitHub source dependency and loosely pinned other dependencies, broadening the trust boundary. The presence of this package on a system implies full compromise, as it grants external control over the WhatsApp account and potentially the host system.
Potential Impact
Any system with this package installed or running is considered fully compromised. The attacker gains remote control capabilities over the installer's WhatsApp account, enabling unauthorized subscription actions. Because the package executes code fetched from a mutable third-party GitHub branch, the attacker can dynamically change commands issued via the WhatsApp session. This compromises confidentiality and integrity of the WhatsApp account and potentially the host system. All secrets and keys stored on the compromised system should be considered exposed and rotated immediately. Removal of the package alone does not guarantee elimination of all malicious software or backdoors.
Defensive Guidance
Immediate removal of the @sanzoffc/baileys package is required. All secrets, keys, and credentials stored on the affected system must be rotated from a separate, trusted device. Due to the high likelihood of full system compromise, a thorough forensic investigation and system rebuild from known good sources is recommended. Monitor for any unauthorized WhatsApp activity and revoke any suspicious sessions. Avoid installing packages from untrusted forks or sources, and verify package integrity before use.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-16281
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-w5cc-9p38-q2wq"]
- Ecosystems
- ["npm"]
Threat ID: 6acd555f2cdf04f656da86a8
Added to database: 10/12/2026, 21:47:11 UTC
Last enriched: 10/12/2026, 22:02:44 UTC
Last updated: 10/12/2026, 22:02:44 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.