Skip to main content

Malicious code in @kanaraa/baileys (npm)

0
Medium
Source: GCVE Database
Product: @kanaraa/baileys

Description

The @kanaraa/baileys npm package, a fork of the Baileys WhatsApp Web library, contains malicious code that silently subscribes the victim's WhatsApp account to attacker-controlled channels without user consent. This is achieved by injecting a covert channel-subscription action into the WhatsApp socket layer, which issues an authenticated FOLLOW query using the installer's own WhatsApp session. The targeted channel JIDs are obfuscated or dynamically fetched, allowing attackers to change targets post-installation. The malicious code does not exfiltrate credentials, establish persistence, or execute arbitrary remote code.

Affected software

npmghsa
@kanaraa/baileys
Affected versions
=3.5.2=3.5.1=3.4.7=3.4.6=3.4.5=3.4.4=3.4.2=3.5.0=3.4.1=3.4.0=3.3.0=3.2.0=3.1.9=3.1.8

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

AILast updated: 09/30/2026, 16:06:00 UTC

Technical Analysis

This threat involves a family of over 100 near-identical malicious forks of the Baileys WhatsApp Web library, including the @kanaraa/baileys package versions 3.1.8 through 3.5.2. The injected code patches the socket-connect routine to issue an authenticated 'w:mex' FOLLOW query to attacker-chosen WhatsApp Channel/Newsletter JIDs shortly after connection. The victim's authenticated WhatsApp session is abused to silently subscribe the account to these channels. Obfuscation techniques such as base64 encoding, XOR, and runtime reconstruction hide the target JIDs, and some variants fetch target lists dynamically from attacker-controlled remote sources. The attack does not involve credential theft, persistence, or arbitrary code execution.

Potential Impact

Victims unknowingly subscribe their WhatsApp accounts to attacker-controlled channels, potentially exposing them to unwanted content or spam. The attack leverages the victim's authenticated session to perform these subscriptions silently. There is no direct credential compromise, persistence, or remote code execution involved.

Mitigation Recommendations

No official patch or remediation guidance is provided in the available data. Users should avoid installing or using the affected versions of the @kanaraa/baileys package. Since the malicious behavior abuses the installer's authenticated WhatsApp session, revoking and reauthorizing WhatsApp sessions and uninstalling the malicious package are recommended. Monitor for suspicious channel subscriptions within WhatsApp. Patch status is not yet confirmed — check the vendor advisory or trusted sources for current remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-17361
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6abd30852a4e24523d3401af

Added to database: 09/30/2026, 15:53:41 UTC

Last enriched: 09/30/2026, 16:06:00 UTC

Last updated: 09/30/2026, 22:41:19 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses