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

@chatbridge-it/baileys

Latest version: v1.2.0

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
AI: Malicious npm package Publisher: chatbridge-it
12 Versions
1.2K Downloads

Scan summary

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

  • Releases: 12 versions; the latest 5 were published on 1 Dec 2026.
  • Findings: 2 rules fired in version 1.2.0 (2 high). The score describes this version only.
  • Downloads: 1,202 downloads.

Versions

12 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.2.0 LATEST 1 Dec 2026 2 rules fired
1.0.9 1 Dec 2026 No rules fired
1.0.8 1 Dec 2026 No rules fired
1.0.7 1 Dec 2026 Not shown
1.0.6 1 Dec 2026 Not shown

Rules fired in 1.2.0: 2

Findings

2 High

Findings for v1.2.0. 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 1.2.0; other versions have their own rules, not their own score.

README

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

chatbridge Baileys

A WhatsApp Web Multi-Device API library for Node.js. It connects to WhatsApp directly over WebSocket, so no browser (Puppeteer, Selenium, etc.) is required.

Disclaimer. This is an unofficial library. It is not affiliated with, authorized by, or endorsed by WhatsApp LLC or Meta. Using it may violate WhatsApp's Terms of Service and can lead to account restrictions or bans. Do not use it for spam, unsolicited bulk messaging, or harassment. You are solely responsible for how you use this software.


Table of Contents

  • Features
  • Requirements
  • Installation
  • Quick Start
  • Authentication
  • Sending Messages
  • Interactive Messages
  • Mentions
  • Groups
  • Newsletters (Channels)
  • Contacts, Profiles and Presence
  • Events
  • Connection Options
  • Disconnect Reasons
  • Session Storage and Security
  • Project Structure
  • Known Limitations
  • Troubleshooting
  • Contributing
  • License

Features

  • WebSocket-based connection, no browser required
  • Multi-device login with QR code or pairing code
  • Built-in multi-file session storage (useMultiFileAuthState) and support for custom auth state
  • Send text, images, videos, audio and voice notes, documents, stickers, locations, contacts, polls, reactions, forwards, edits, deletes and view-once media
  • Interactive messages with buttons (URL, copy code, quick reply and native flow buttons)
  • Group management: create, metadata, subject, description, participants, invite codes, join requests, member labels
  • Channel (newsletter) management: create, follow, mute, metadata, reactions, resolve a channel from its URL
  • Contacts, profile picture, profile name and status, privacy settings, block list, presence
  • Fully event-driven API through sock.ev
  • Configurable timeouts, retry behavior, logging (pino) and history sync

Requirements

  • Node.js 20 or newer. The preinstall script (engine-requirements.js) stops the installation on older versions.
  • A WhatsApp account that can link a companion device (QR code or pairing code).

Optional peer dependencies. Install only what you need:

Package Used for Notes
qrcode-terminal Printing QR codes in the terminal Used in the quick start below
sharp Image and video thumbnails Declared peer range is ^0.32.2, install that version
jimp Thumbnails if sharp is not available Alternative to sharp
link-preview-js Link previews in text messages Optional
npm install qrcode-terminal

Installation

Install the library from npm:

npm install @chatbridge-it/baileys

Import it in CommonJS:

const {
    makeWASocket,
    useMultiFileAuthState,
    fetchLatestBaileysVersion,
    DisconnectReason
} = require("@chatbridge-it/baileys");

In ES modules, import the default export and destructure it:

import baileys from "@chatbridge-it/baileys";
const { makeWASocket, useMultiFileAuthState, fetchLatestBaileysVersion, DisconnectReason } = baileys;

Quick Start

This example logs in with a QR code, replies pong to ping, and reconnects automatically unless the session was logged out.

const {
    makeWASocket,
    useMultiFileAuthState,
    fetchLatestBaileysVersion,
    DisconnectReason
} = require("@chatbridge-it/baileys");
const qrcode = require("qrcode-terminal");

async function start() {
    const { state, saveCreds } = await useMultiFileAuthState("auth_info");
    const { version } = await fetchLatestBaileysVersion();

    const sock = makeWASocket({
        version,
        auth: state,
        printQRInTerminal: false
    });

    sock.ev.on("creds.update", saveCreds);

    sock.ev.on("connection.update", ({ connection, lastDisconnect, qr }) => {
        if (qr) {
            qrcode.generate(qr, { small: true });
        }

        if (connection === "open") {
            console.log("Connected");
        }

        if (connection === "close") {
            const statusCode = lastDisconnect?.error?.output?.statusCode;

            if (statusCode === DisconnectReason.loggedOut) {
                console.log("Logged out. Delete the auth_info folder and pair again.");
            } else {
                start();
            }
        }
    });

    sock.ev.on("messages.upsert", async ({ messages, type }) => {
        if (type !== "notify") return;

        for (const msg of messages) {
            if (!msg.message || msg.key.fromMe) continue;

            const text = msg.message.conversation || msg.message.extendedTextMessage?.text;

            if (text === "ping") {
                await sock.sendMessage(msg.key.remoteJid, { text: "pong" }, { quoted: msg });
            }
        }
    });
}

start().catch(console.error);

Run it with node index.js, then scan the QR code from WhatsApp on your phone: Settings > Linked devices > Link a device.


Authentication

QR code

The library emits a qr value through connection.update. Render it however you like. The example above uses qrcode-terminal.

Pairing code

Pairing codes let you link a device by typing a code on your phone instead of scanning a QR code. Request it only when the account is not registered yet:

if (!sock.authState.creds.registered) {
    const phoneNumber = "15551234567"; // digits only, including the country code

    setTimeout(async () => {
        // Pass null to get a random code, or pass your own code as the second argument
        const code = await sock.requestPairingCode(phoneNumber, null);
        console.log("Pairing code:", code);
    }, 3000);
}

On your phone: Settings > Linked devices > Link a device > Link with phone number instead, then enter the code.

  • A custom code is converted to uppercase by the library.
  • Always pass the second argument explicitly. If you omit it, the library uses a fixed default code that is defined in its source code, so anyone can know it. Pass null for a random code, or a code that is not predictable.
Persisting the session

Save credentials every time they change, otherwise you will have to pair again after restarting:

sock.ev.on("creds.update", saveCreds);

Sending Messages

Every message is sent with sock.sendMessage(jid, content, options). A JID is a WhatsApp address: 15551234567@s.whatsapp.net for a user, 120363...@g.us for a group, and ...@newsletter for a channel.

Text
await sock.sendMessage(jid, { text: "Hello" });
Reply (quote) a message
await sock.sendMessage(jid, { text: "Got it" }, { quoted: msg });
Mentions
await sock.sendMessage(groupJid, {
    text: "@15551234567 welcome!",
    mentions: ["15551234567@s.whatsapp.net"]
});
Image, video and view-once

image, video and document accept a Buffer, a local file read with fs.readFileSync, or a { url } object.

const fs = require("fs");

await sock.sendMessage(jid, { image: { url: "https://example.com/photo.jpg" }, caption: "Look" });
await sock.sendMessage(jid, { video: fs.readFileSync("./clip.mp4"), caption: "Clip" });
await sock.sendMessage(jid, { image: fs.readFileSync("./photo.jpg"), viewOnce: true });
Audio and voice note
await sock.sendMessage(jid, { audio: { url: "./song.mp3" }, mimetype: "audio/mp4" });

// Voice note (push-to-talk), Opus in an OGG container
await sock.sendMessage(jid, {
    audio: fs.readFileSync("./note.ogg"),
    mimetype: "audio/ogg; codecs=opus",
    ptt: true
});
Document
await sock.sendMessage(jid, {
    document: fs.readFileSync("./report.pdf"),
    mimetype: "application/pdf",
    fileName: "report.pdf",
    caption: "Monthly report"
});
Sticker

Stickers must be WebP files.

await sock.sendMessage(jid, { sticker: fs.readFileSync("./sticker.webp") });
Location
await sock.sendMessage(jid, {
    location: {
        degreesLatitude: 41.9028,
        degreesLongitude: 12.4964,
        name: "Rome",
        address: "Piazza Venezia"
    }
});
Contact card
const vcard = [
    "BEGIN:VCARD",
    "VERSION:3.0",
    "FN:Jane Doe",
    "TEL;type=CELL;waid=15551234567:+1 555 123 4567",
    "END:VCARD"
].join("\n");

await sock.sendMessage(jid, { contacts: { displayName: "Jane Doe", contacts: [{ vcard }] } });
Poll
await sock.sendMessage(jid, {
    poll: {
        name: "Lunch?",
        values: ["Pizza", "Sushi", "Salad"],
        selectableCount: 1
    }
});
Reaction
await sock.sendMessage(jid, { react: { text: "👍", key: msg.key } });

Send an empty text to remove the reaction.

Edit, delete and forward

sendMessage returns the sent message, including its key, which you need to edit or delete it later.

const sent = await sock.sendMessage(jid, { text: "Draft" });

await sock.sendMessage(jid, { text: "Final version", edit: sent.key });
await sock.sendMessage(jid, { delete: sent.key });

await sock.sendMessage(jid, { forward: msg, force: true });

Edits only work on messages sent by your account. WhatsApp limits how long after sending a message edits and deletes are still allowed.

Read receipts and typing indicator
await sock.readMessages([msg.key]);

await sock.sendPresenceUpdate("composing", jid); // typing
await sock.sendPresenceUpdate("paused", jid);    // stopped typing

Supported presence types: available, unavailable, composing, recording, paused.


Interactive Messages

Interactive messages add a text body, an optional header title, a footer and native-flow buttons. Pass the buttons in interactiveButtons.

await sock.sendMessage(jid, {
    text: "Your order has shipped.",     // body
    title: "Order update",               // optional header
    footer: "chatbridge",                // optional footer
    interactiveButtons: [
        {
            name: "cta_url",
            buttonParamsJson: JSON.stringify({
                display_text: "Track order",
                url: "https://example.com/track"
            })
        },
        {
            name: "cta_copy",
            buttonParamsJson: JSON.stringify({
                display_text: "Copy code",
                id: "ORDER-1234",
                copy_code: "ORDER-1234"
            })
        },
        {
            name: "quick_reply",
            buttonParamsJson: JSON.stringify({
                display_text: "Thanks!",
                id: "thanks"
            })
        }
    ]
}, { quoted: msg });
  • name is required. buttonParamsJson can be a JSON string or a plain object (it is converted for you).
  • Common button names: cta_url (open a link), cta_copy (copy a code or link), cta_call (call a number), quick_reply (send a reply back).
  • mentions works on interactive messages as well.

Button rendering depends on the recipient's WhatsApp app version and account type, and WhatsApp may change or restrict these message types at any time. Test with your target accounts before relying on them in production.


Mentions

To tag people, write @number in the text. Two ways to make it a real mention:

// 1) explicit list (recommended): exactly these JIDs are mentioned
await sock.sendMessage(jid, {
    text: "Welcome @393331234567!",
    mentions: ["393331234567@s.whatsapp.net"]
});

// 2) automatic: without `mentions`, every @number (7-15 digits) in the text or caption is mentioned
await sock.sendMessage(jid, { text: "Welcome @393331234567!" });
  • Use autoMentions: false to turn the automatic detection off.
  • Your own contextInfo (for example externalAdReply) is merged with the mentions, never replaces them.
  • WhatsApp shows the contact name only if the person is in the group or saved in the viewer's contacts. Someone who has just left a group is shown as a plain number.

Groups

// Create a group
const group = await sock.groupCreate("Team", ["15551234567@s.whatsapp.net"]);

// Metadata
const meta = await sock.groupMetadata(group.id);

// Subject and description
await sock.groupUpdateSubject(group.id, "Team (renamed)");
await sock.groupUpdateDescription(group.id, "Project discussions");

// Participants: action is "add", "remove", "promote" or "demote"
await sock.groupParticipantsUpdate(group.id, ["15557654321@s.whatsapp.net"], "add");

// Invite link code
const inviteCode = await sock.groupInviteCode(group.id);

// Groups the account participates in
const groups = await sock.groupFetchAllParticipating();

// Member label shown in the group (trimmed to 30 characters)
await sock.setLabelGroup(group.id, "Admin");

// Leave
await sock.groupLeave(group.id);

Pending join requests can be handled with groupRequestParticipantsUpdate(jid, participants, action).


Newsletters (Channels)

// Resolve a channel from its link or bare invite key
const channel = await sock.newsletterFromUrl("https://whatsapp.com/channel/XXXXXXXXXXXX");
// -> { id, name, description, subscribers, verification, creation_time, ... }

// Create a channel. The third argument is the reaction setting string, converted to uppercase
const created = await sock.newsletterCreate("Updates", "Official updates", "all");

// Follow and mute
await sock.newsletterFollow(channel.id);
await sock.newsletterMute(channel.id);

// React to a channel post
await sock.newsletterReactMessage(channel.id, serverId, "👍");

// Remove the reaction
await sock.newsletterReactMessage(channel.id, serverId);

newsletterMetadata(type, key, role) gives direct access to channel metadata when you already have the channel key.


Contacts, Profiles and Presence

// Check which numbers have a WhatsApp account. Returns an array with jid and exists fields.
const results = await sock.onWhatsApp("15551234567");

// Profile picture: type is "preview" (default) or "image"
const picUrl = await sock.profilePictureUrl(jid, "image");

// Status text of a contact
const status = await sock.fetchStatus(jid);

// Your profile
await sock.updateProfileName("chatbridge Bot");
await sock.updateProfileStatus("Available 24/7");
await sock.updateProfilePicture(sock.user.id, fs.readFileSync("./avatar.jpg"));

// Privacy and block list
await sock.updateLastSeenPrivacy("contacts");
await sock.updateBlockStatus(jid, "block");   // "block" or "unblock"
const blocked = await sock.fetchBlocklist();

// Presence: subscribe to a contact's online status
await sock.presenceSubscribe(jid);

Events

Listen to events through sock.ev.on(eventName, handler).

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 @chatbridge-it/baileys

References

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

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

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

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229