Malicious Code Injection in @sakataoffc/baileys: Covert Channel Subscription Vulnerability
Summary
MAL-2026-17379: Malicious code in @sakataoffc/baileys (npm). Affects @sakataoffc/baileys versions 1.0.0 – 8.0.0. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The @sakataoffc/baileys package is a fork of the Baileys WhatsApp Web library, designed to facilitate interactions with the WhatsApp Web API. It is part of a larger family of similar packages that have been identified as potentially malicious. This package allows developers to build applications that can send and receive messages on WhatsApp, but it has been compromised to include malicious code that exploits user accounts.
Vulnerability Detail
The vulnerability originates from a malicious code injection within the @sakataoffc/baileys package. Upon connection, the injected code executes an authenticated 'w:mex' FOLLOW query against attacker-chosen WhatsApp Channel/Newsletter JIDs using the victim's authenticated session. This silently subscribes the victim's account to channels without their consent. The malicious action is obfuscated through various techniques, making it difficult for users to detect. While it does not exfiltrate credentials or execute arbitrary remote code, it abuses the user's session for unauthorized subscriptions.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @sakataoffc/baileys
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, avoid using the @sakataoffc/baileys package until it has been confirmed safe. Consider using alternative libraries for WhatsApp Web interactions that do not exhibit these vulnerabilities.
Conclusion
The @sakataoffc/baileys package has been compromised to include malicious code that exploits user accounts for unauthorized channel subscriptions. Users are advised to update to the latest version or seek alternatives to mitigate risks associated with this vulnerability.
See every vulnerability recorded for @sakataoffc/baileys →
FAQ
The primary risk is that the user's WhatsApp account may be silently subscribed to channels they did not authorize, potentially leading to unwanted notifications and privacy concerns.
You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. By utilizing the Vulert playground, you can check if your application is affected without any signup.
If you have installed the affected package, immediately update to the latest version or remove the package from your project to mitigate the risk.
Yes, there are over 100 identified forks of the Baileys library that exhibit similar malicious behavior, each using different obfuscation techniques.
No, this vulnerability does not exfiltrate credentials; it only abuses the authenticated session to subscribe to channels.