Malicious Code Injection in @wanzlonely/bails4u: Covert Channel Subscription Vulnerability
Summary
MAL-2026-17381: Malicious code in @wanzlonely/bails4u (npm). Affects @wanzlonely/bails4u versions 2.0.0 – 5.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 @wanzlonely/bails4u package is a fork of the Baileys WhatsApp Web library, designed to facilitate interactions with WhatsApp's web interface. This package is part of a larger family of over 100 similar forks, which share common functionalities but may differ in implementation details. The vulnerability arises from the package's ability to inject malicious code into the WhatsApp socket layer, allowing unauthorized actions to be performed using the installer's authenticated session.
Vulnerability Detail
The vulnerability in @wanzlonely/bails4u allows an attacker to inject a covert channel-subscription action into the WhatsApp socket layer. Upon connection, the injected code executes an authenticated 'w:mex' FOLLOW query against attacker-controlled WhatsApp Channel/Newsletter JIDs, using the victim's own authenticated session. This results in the victim's account being silently subscribed to channels without their consent. The malicious code employs various obfuscation techniques to hide the target JIDs, making it difficult for users to detect the malicious behavior. While the vulnerability does not exfiltrate credentials or execute arbitrary remote code, it does exploit 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 @wanzlonely/bails4u
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, you can remove the @wanzlonely/bails4u package from your project by running 'npm uninstall @wanzlonely/bails4u'. This will prevent any malicious code from executing until an updated version is available.
Conclusion
The @wanzlonely/bails4u package contains a significant vulnerability that allows attackers to exploit users' authenticated WhatsApp sessions for unauthorized channel subscriptions. It is crucial to update to a patched version or remove the package to mitigate risks. Regular monitoring of dependencies using tools like Vulert can help maintain security.
See every vulnerability recorded for @wanzlonely/bails4u →
FAQ
The vulnerability allows for the injection of malicious code that subscribes the victim's WhatsApp account to channels without their consent.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. By checking your package-lock.json file, you can determine if your application is affected.
As a workaround, you can uninstall the package to prevent any malicious actions until a secure version is available.
While the primary risk is unauthorized subscriptions, the vulnerability does not exfiltrate credentials or execute arbitrary remote code, limiting its impact.
Utilizing tools like Vulert can help you monitor your dependencies for vulnerabilities without needing to access the code directly.