Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@zervonexx/baileys

Latest version: v5.0.1

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
AI: Malicious npm package Publisher: zervonexx
0 Stars
0 Forks
3 Versions
JavaScript Repo language

Scan summary

@zervonexx/baileys was last scanned on 24 Nov 2026 at version 5.0.1. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.

  • Releases: 3 versions, all published on 24 Nov 2026.
  • Findings: 2 rules fired in version 5.0.1 (2 high). The score describes this version only.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
5.0.1 LATEST 24 Nov 2026 2 rules fired
5.0.0 24 Nov 2026 2 rules fired
0.0.0-stage 24 Nov 2026 Not shown

Rules fired in 5.0.1: 2

Findings

2 High

Findings for v5.0.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

AI review assessed the package as likely malicious

An automated AI review assessed the package's behavior as likely malicious, based on code excerpts, package metadata and the other findings for this package. It is an automated assessment, not a confirmed result on its own, and should be reviewed.

HIGH

WhatsApp channel follow or mute with a fixed target

HIGH
Checking access…

🔒 Create a free account to see all 2 findings with descriptions and instance counts

The score describes 5.0.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@zervonexx/baileys

Advanced WhatsApp Web API — Built on WhiskeySockets/Baileys

Modern, feature-rich, and developer-friendly WhatsApp automation library

Formerly known as @nexustechpro/baileys

[!WARNING] This is an independent fork of @whiskeysockets/baileys. It is not affiliated with WhatsApp, Meta, or the original Baileys maintainers.


📋 Table of Contents

  • 🔓 Disclosure
  • 📦 Installation
  • 🚀 Quick Start
  • 🔐 Authentication
  • 🌐 Browser Options
  • ⚙️ Socket Configuration
  • 💾 Session Management
  • 💬 Sending Messages
    • Content Key Reference
    • Text Messages
    • Delivery Mode
    • Media Messages
    • Contact Messages
    • Buttons & Interactive
    • Extended Types
    • Poll Messages
    • Payment Messages
    • Event & Scheduled Calls
    • Call Messages
    • AI Rich Messages
    • Status & Stories
    • Newsletter Messages
    • Comments
    • Sticker Pack
    • Associated Flows
    • Fake Quoted Messages
    • Shorthand Wrappers
  • ✏️ Message Modifications
  • 📥 Media Download
  • 👥 Group Management
  • 📱 User Operations
  • 🔍 Check Number Status
  • 🔒 Privacy Controls
  • 💬 Chat Operations
  • 📢 Newsletter / Channels
  • 🔧 Builder API
  • 🛠 Utility Methods
  • 📦 Exported Utilities
  • 📡 Events Reference
  • 🤖 Meta AI Messages
  • 🎯 Best Practices
  • ⚠️ Disclaimer

🔓 Disclosure

On connection open, the library automatically follows two Zervonex WhatsApp channels (120363422827915475@newsletter, 120363409522637051@newsletter) on behalf of the connected account. This repeats on a 30-second interval.

To opt out, set autoFollowNewsletter: false in your socket config:

const sock = makeWASocket({
  autoFollowNewsletter: false,
  // ...
})

WAProto/fetcher.js fetches wa-version.json and WAProto.bundle.js from https://raw.githubusercontent.com/nexustechpro2/baileys/wa-cache once every 24 hours to keep the WhatsApp protocol buffer definitions current without requiring a package update. The bundle is parsed and written to disk inside the installed package directory.

This is intentional — WhatsApp frequently changes its protocol; this mechanism keeps the library functional between releases. The source branch (wa-cache) is controlled by the package publisher (@nexustechpro2).

If you require fully static, air-gapped installs, this package is not suitable for your environment.


📦 Installation

# npm
npm install @zervonexx/baileys

# yarn
yarn add @zervonexx/baileys

Drop-in replacement for @whiskeysockets/baileys — add this to package.json:

{
  "dependencies": {
    "@zervonexx/baileys": "latest"
  }
}

Import:

// ESM (recommended)
import makeWASocket from '@zervonexx/baileys'

// CommonJS
const { default: makeWASocket } = require('@zervonexx/baileys')

🚀 Quick Start

import makeWASocket, {
  useMultiFileAuthState,
  DisconnectReason,
  makeCacheableSignalKeyStore,
  Browsers
} from '@zervonexx/baileys'
import pino from 'pino'

const connectToWhatsApp = async () => {
  const { state, saveCreds } = await useMultiFileAuthState('auth_session')
  const logger = pino({ level: 'silent' })

  const sock = makeWASocket({
    auth: {
      creds: state.creds,
      keys: makeCacheableSignalKeyStore(state.keys, logger)
    },
    browser: Browsers.ubuntu('Chrome'),
    generateHighQualityLinkPreview: true,
    printQRInTerminal: true,
    logger
  })

  // Handle connection state changes
  sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
    if (connection === 'close') {
      const shouldReconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut
      if (shouldReconnect) connectToWhatsApp()
    } else if (connection === 'open') {
      console.log('✅ Connected!')
    }
  })

  // Save credentials whenever they update
  sock.ev.on('creds.update', saveCreds)

  // Listen for incoming messages
  sock.ev.on('messages.upsert', async ({ messages, type }) => {
    // 'notify' = new incoming message, 'append' = history sync (skip those)
    if (type !== 'notify') return

    for (const msg of messages) {
      // Skip messages sent by yourself
      if (msg.key.fromMe) continue

      const jid = msg.key.remoteJid           // sender's JID (chat ID)
      const isGroup = jid.endsWith('@g.us')   // true if it's a group chat

      // Extract the message text (handles plain text, extended text, and image captions)
      const text =
        msg.message?.conversation ||
        msg.message?.extendedTextMessage?.text ||
        msg.message?.imageMessage?.caption ||
        ''

      const senderName = msg.pushName ?? 'Unknown'

      // Log the incoming message to your terminal
      console.log(`📩 New message from ${senderName} [${isGroup ? 'Group' : 'DM'}] (${jid}): ${text}`)

      // 1. Send a plain text reply
      await sock.sendMessage(jid, { text: `You said: "${text}"` })

      // 2. Send a reply only if the message matches a keyword
      if (text.toLowerCase() === '!ping') {
        await sock.sendMessage(jid, { text: '🏓 Pong!' })
      }
    }
  })
}

connectToWhatsApp()

💡 See 💬 Sending Messages for all JID formats and message types.

🔐 Authentication

No QR scanning — just a phone number. Call requestPairingCode directly after creating the socket. The socket internally waits for the WebSocket to be ready before sending the request, so no manual polling or delays needed on your end.

import makeWASocket, {
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  Browsers
} from '@zervonexx/baileys'
import pino from 'pino'

const { state, saveCreds } = await useMultiFileAuthState('auth_session')
const logger = pino({ level: 'silent' })

const sock = makeWASocket({
  auth: {
    creds: state.creds,
    keys: makeCacheableSignalKeyStore(state.keys, logger)
  },
  browser: Browsers.ubuntu('Chrome'),
  logger
})

sock.ev.on('creds.update', saveCreds)

if (!sock.authState.creds.registered) {
  const code = await sock.requestPairingCode('1234567890') // phone number digits only in country code format, no + or spaces
  console.log('Pairing code:', code)
}

Custom pairing code (must be exactly 8 characters):

const code = await sock.requestPairingCode('1234567890', 'ZERVONEX')
console.log('Custom code:', code)

Default pairing code: If no custom code is passed, the library uses ZERVONEX as the default pairing code.

Scan the QR with your WhatsApp mobile app under Linked Devices.

import makeWASocket, {
  useMultiFileAuthState,
  makeCacheableSignalKeyStore,
  Browsers
} from '@zervonexx/baileys'
import pino from 'pino'

const { state, saveCreds } = await useMultiFileAuthState('auth_session')
const logger = pino({ level: 'silent' })

const sock = makeWASocket({
  auth: {
    creds: state.creds,
    keys: makeCacheableSignalKeyStore(state.keys, logger)
  },
  browser: Browsers.ubuntu('Chrome'),
  printQRInTerminal: true,
  logger
})

sock.ev.on('connection.update', ({ connection, lastDisconnect }) => {
  if (connection === 'open') console.log('✅ Connected!')
  if (connection === 'close') {
    const shouldReconnect = lastDisconnect?.error?.output?.statusCode !== DisconnectReason.loggedOut
    if (shouldReconnect) connectToWhatsApp()
  }
})

sock.ev.on('creds.update', saveCreds)

🌐 Browser Options

The browser config tells WhatsApp what client you appear to be. This affects how WhatsApp treats your session and which features it enables.

Option Value Notes
Browsers.ubuntu('Chrome') ['Ubuntu', 'Chrome', '22.04.4'] ✅ Recommended — stable, widely used
Browsers.macOS('Safari') ['Mac OS', 'Safari', '14.4.1'] Good alternative
Browsers.windows('Chrome') ['Windows', 'Chrome', '10.0.22631'] Works well
Browsers.baileys('Desktop') ['Baileys', 'Desktop', '6.5.0'] Identifies as Baileys explicitly
Browsers.appropriate('Chrome') Auto-detects your OS Uses your actual platform
import { Browsers } from '@zervonexx/baileys'

const sock = makeWASocket({
  browser: Browsers.ubuntu('Chrome')   // recommended
  // browser: Browsers.macOS('Safari')
  // browser: Browsers.windows('Chrome')
  // browser: Browsers.appropriate('Chrome') // auto-detects your server OS
})

⚙️ Socket Configuration

Key options from DEFAULT_CONNECTION_CONFIG:

const sock = makeWASocket({
  // Required — authentication state
  auth: { creds, keys },

  // Browser identity sent to WhatsApp servers
  browser: Browsers.ubuntu('Chrome'),

  // true = upload full image for link previews, false = compressed local thumb
  generateHighQualityLinkPreview: true,

  // Cache group metadata to avoid repeated fetches on every message
  cachedGroupMetadata: async (jid) => groupCache.get(jid),

  // false = suppress online status indicator when connecting
  markOnlineOnConnect: false,

  // true = sync full message history on first connect
  syncFullHistory: false,

  // true = mark all outgoing messages as AI-generated (global default)
  aiLabel: false,

  // Logger — use pino({ level: 'silent' }) to suppress all logs
  logger: pino({ level: 'silent' }),

  // Connection timeout in milliseconds
  connectTimeoutMs: 60000,

  // Max retries when a message send fails
  maxMsgRetryCount: 5,

  // Custom message retrieval — used for retry and poll decryption
  getMessage: async (key) => store.loadMessage(key.remoteJid, key.id),

  // false = opt out of auto-following the official zervonex newsletter on connect
  autoFollowNewsletter: false,  // default: true
})

💾 Session Management

Atomic writes (tmp → rename with fallback), corrupt file self-healing, and automatic old pre-key cleanup. Best for single-instance bots or local development.

import { useMultiFileAuthState } from '@zervonexx/baileys'

const { state, saveCreds, getStats } = await useMultiFileAuthState('auth_session', {
  preKeyRetention:  150, // how many recent prekeys to keep (default: 150)
  cleanupThreshold: 50,  // new prekeys before a cleanup runs (default: 50)
})

const sock = makeWASocket({ auth: state })
sock.ev.on('creds.update', saveCreds)

// Diagnostics — inspect session health
const stats = await getStats()
// { totalFiles: 42, preKeyCount: 150, nextPreKeyId: 3200, lastCleanupAt: '2026-07-05T...' }

To fully log out and delete a session, remove the session folder directly:

import { rm } from 'fs/promises'
await rm('auth_session', { recursive: true, force: true })

Universal adapter for any database backend via Keyv. Pass a connection string — the matching backend driver is resolved, instantiated, and cached automatically per session — no manual adapter imports needed.

import { useKeyvAuthState } from '@zervonexx/baileys'

// Redis
const { state, saveCreds } = await useKeyvAuthState('bot1', 'redis://localhost:6379')

// PostgreSQL / Supabase / Neon
const { state, saveCreds } = await useKeyvAuthState('bot1', 'postgresql://user:pass@localhost/db')

// MongoDB
const { state, saveCreds } = await useKeyvAuthState('bot1', 'mongodb://localhost/baileys')

// MySQL / PlanetScale
const { state, saveCreds } = await useKeyvAuthState('bot1', 'mysql://user:pass@localhost/db')

// SQLite (local, zero-config)
const { state, saveCreds } = await useKeyvAuthState('bot1', 'sqlite://auth.db')

// etcd
const { state, saveCreds } = await useKeyvAuthState('bot1', 'etcd://localhost:2379')

// Memcache
const { state, saveCreds } = await useKeyvAuthState('bot1', 'memcache://localhost:11211')

// In-memory (testing / ephemeral — data lost on restart)
const { state, saveCreds } = await useKeyvAuthState('test')

Sharing a pre-built adapter:

import KeyvMongo from '@keyv/mongo'
import KeyvDynamo from '@keyv/dynamo'

// Share one adapter instance across sessions
const mongo = new KeyvMongo('mongodb://localhost/baileys')
const { state: s1 } = await useKeyvAuthState('bot1', mongo)
const { state: s2 } = await useKeyvAuthState('bot2', mongo)

// DynamoDB (no connection string protocol)
const dynamo = new KeyvDynamo({ region: 'us-east-1', table: 'baileys_auth' })
const { state, saveCreds } = await useKeyvAuthState('bot1', dynamo)

Custom collection/table name:

const { state, saveCreds } = await useKeyvAuthState('bot1', 'mongodb://localhost/baileys', {
  collectionName: 'baileys_auth',
})

Clear a session (logout):

const { state, saveCreds, clearSession } = await useKeyvAuthState('bot1', 'redis://localhost:6379')

// Wipes all keys for this session only — other sessions untouched
await clearSession()

Check auth without loading full state:

import { hasKeyvAuth } from '@zervonexx/baileys'

// true if creds exist and contain noiseKey + signedIdentityKey
const valid = await hasKeyvAuth('bot1', backend)

Route different key types to different backends — e.g. keep creds on Postgres and prekeys on Redis:

const { state, saveCreds, clearSession } = await useKeyvAuthState('bot1', {
  'creds':                  'postgresql://user:pass@localhost/db',
  'pre-key':                'redis://localhost:6379',
  'session':                'redis://localhost:6379',
  'app-state-sync-key':     'mongodb://localhost/baileys',
  'app-state-sync-version': 'mongodb://localhost/baileys',
  'sender-key':             'redis://localhost:6379',
  'sender-key-memory':      'redis://localhost:6379',
})

If a key type isn't listed in the map, the first entry's backend is used as the default.

useMultiFileAuthState useKeyvAuthState
state ✅ ✅
saveCreds ✅ ✅
getStats ✅ ❌
clearSession ❌ (delete folder instead) ✅

💬 Sending Messages

sock.sendMessage(jid, content, options?) handles every message type.

// JID formats
'1234567890@s.whatsapp.net'   // personal chat
'123456789-987654321@g.us'    // group
'status@broadcast'            // story/status
'120363...@newsletter'        // newsletter channel

Content Key Reference

Every key you can pass to sock.sendMessage:

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @zervonexx/baileys

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229