Malicious Code Injection in @hanzofc/baileys: Covert Channel Subscription Vulnerability
Summary
MAL-2026-17354: Malicious code in @hanzofc/baileys (npm). Affects @hanzofc/baileys versions 7.0.0 – 7.0.1. 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 @hanzofc/baileys package is a fork of the Baileys WhatsApp Web library, designed to facilitate interactions with the WhatsApp Web API. It allows developers to build applications that can send and receive messages, manage contacts, and perform various WhatsApp functionalities. However, this package has been identified as part of a larger family of malicious forks that inject harmful code into the WhatsApp socket layer, compromising user accounts.
Vulnerability Detail
The vulnerability arises from malicious code embedded within the @hanzofc/baileys package, which executes an unauthorized FOLLOW query to subscribe the victim's WhatsApp account to attacker-controlled channels. This occurs without the user's consent, leveraging the user's authenticated session to gain subscribers for malicious purposes. The code obfuscation techniques used to hide the target JIDs include base64 encoding and runtime reconstruction, making it difficult for users to detect the malicious behavior.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @hanzofc/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, consider removing the @hanzofc/baileys package from your project until a secure version is confirmed. You can do this by running: npm uninstall @hanzofc/baileys. Additionally, monitor your application for any unauthorized subscriptions or activities.
Conclusion
The @hanzofc/baileys package has been identified as containing malicious code that can compromise user accounts by subscribing them to unwanted channels. It is essential to update the package to a secure version and monitor your applications for any suspicious activities. Utilizing tools like Vulert can help in identifying vulnerabilities in real-time.
See every vulnerability recorded for @hanzofc/baileys →
FAQ
The vulnerability allows attackers to subscribe the victim's WhatsApp account to channels without their consent, potentially leading to unwanted notifications and privacy concerns.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without any signup.
To prevent similar vulnerabilities, always review package dependencies, use trusted sources, and keep your packages updated regularly.
If you suspect your account has been compromised, immediately revoke access to suspicious applications and change your WhatsApp password.
Yes, there are over 100 identified variants of this vulnerability, each using different obfuscation techniques to hide malicious actions.