Scan your whole stack
From OX Research Newsroom
Are you using @ndikagantengg/baileys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v7.0.7
@ndikagantengg/baileys was last scanned on 3 Nov 2026 at version 7.0.7. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.
| Version | Published | Status |
|---|---|---|
| 7.0.7 LATEST | 3 Nov 2026 | 2 rules fired |
| 7.0.6 | 15 Oct 2026 | No rules fired |
| 7.0.5 | 12 Oct 2026 | No rules fired |
| 7.0.4 | 12 Oct 2026 | Not shown |
| 7.0.3 | 11 Oct 2026 | Not shown |
Findings for v7.0.7. 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.
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.
HIGHThe score describes 7.0.7; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
[!IMPORTANT] This project is a modified fork of WhiskeySockets/Baileys.
The original Baileys project and its upstream contributors are credited below. This fork is independently maintained and published as
@ndikz/baileys.
@ndikz/baileys is a customized fork of Baileys, a TypeScript library for interacting with WhatsApp Web through WebSockets.
This fork is maintained separately from the upstream project and contains additional fixes, modifications, and changes used by the author for WhatsApp automation projects.
biz nodes)richMenu and sendHtml helpersuseSqliteAuthState (single-file SQLite auth storage)isSecret, protected, me)This fork is based on WhiskeySockets/Baileys 7.0.0-rc14 (compared against upstream commit 0af2386, "advertise WIN_HYBRID instead of retired WIN32 web sub-platform"). Everything else in the library behaves like upstream.
| Area | Upstream | This fork |
|---|---|---|
| Package name | baileys |
@ndikz/baileys |
| Version | 7.0.0-rc14 |
7.0.0 |
| Auth state | useMultiFileAuthState |
Adds useSqliteAuthState (needs Node 22.5+) |
sendMessage content |
Standard content types | Adds productMessage, orderMessage, requestPaymentMessage, eventMessage, albumMessage, pollResultMessage, groupStatus, groupLabel |
| Extra socket methods | - | richMenu(jid, content), sendHtml(jid, html) |
| Interactive messages | Sent as-is | Adds biz / native_flow / bot nodes automatically for buttons, lists and native flow |
relayMessage options |
participant (retry resend) |
Retry resend renamed to participants; participant now means "recipient only"; adds isSecret, protected, me |
| Client platform | WEB, or ANDROID if the browser name contains "android" |
Always MACOS |
| On connect | Nothing extra | Auto-follows the newsletter JIDs listed in AUTO_FOLLOW_NEWSLETTER_JIDS |
| Protobuf | Upstream definitions | Adds BloksWidget to WAProto |
| Build output | - | ESM imports use explicit .js extensions |
[!WARNING] Some of these changes affect behavior or the public API. Read the sections below before upgrading from upstream.
engine-requirements.js on install)useSqliteAuthState (it relies on the built-in node:sqlite module)Retry resend option renamed. Upstream passes { participant: { jid, count } } to relayMessage when re-sending after a failed decryption. In this fork that option is participants. participant: { jid } (without count) now targets only that recipient. If you call relayMessage directly with the old shape, update your code.
Client platform is always MACOS. Upstream chooses WEB (or ANDROID when browser[1] contains "android"). This fork always advertises MACOS in the client payload.
Install the package directly from npm:
npm install @ndikz/baileys
Using yarn:
yarn add @ndikz/baileys
Using pnpm:
pnpm add @ndikz/baileys
baileysIf your project already imports the package using:
import makeWASocket from 'baileys'
you can install this fork using an npm alias:
npm install baileys@npm:@ndikz/baileys
This allows existing imports using baileys to continue working without changing every import in your project.
import makeWASocket from '@ndikz/baileys'
const sock = makeWASocket({
// options
})
If you installed the package using the npm alias:
npm install baileys@npm:@ndikz/baileys
you can continue using:
import makeWASocket from 'baileys'
Baileys uses an authentication state to store the credentials required to reconnect to WhatsApp.
A common setup is to use useMultiFileAuthState:
import makeWASocket, {
DisconnectReason,
useMultiFileAuthState
} from '@ndikz/baileys'
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys')
const sock = makeWASocket({
auth: state
})
sock.ev.on('creds.update', saveCreds)
The authentication files should generally not be committed to Git.
Add your authentication directory to .gitignore:
auth_info_baileys/
As an alternative to many JSON files, the whole auth state can be stored in a single SQLite database:
import makeWASocket, { useSqliteAuthState } from '@ndikz/baileys'
const { state, saveCreds, close } = await useSqliteAuthState('./auth')
const sock = makeWASocket({ auth: state })
sock.ev.on('creds.update', saveCreds)
Notes:
node:sqlite). On older versions it throws and you should use useMultiFileAuthState instead..db / .sqlite / .sqlite3 file path or a folder. For a folder the file is auth.db unless you set fileName.useMultiFileAuthState folder, pass migrateFromFolder. It is only used when the database has no credentials yet.close() when you shut the socket down.const { state, saveCreds } = await useSqliteAuthState('./auth', {
fileName: 'auth.db',
migrateFromFolder: './auth_info_baileys'
})
Add the database to .gitignore as well:
auth/
You can listen for connection updates using connection.update:
sock.ev.on('connection.update', (update) => {
const { connection, lastDisconnect } = update
if (connection === 'close') {
console.log('connection closed')
const shouldReconnect =
(lastDisconnect?.error as any)?.output?.statusCode !== DisconnectReason.loggedOut
if (shouldReconnect) {
// reconnect
}
}
if (connection === 'open') {
console.log('connected')
}
})
await sock.sendMessage(jid, {
text: 'Hello World!'
})
await sock.sendMessage(jid, {
image: { url: './image.jpg' },
caption: 'Hello!'
})
await sock.sendMessage(jid, {
video: { url: './video.mp4' },
caption: 'Hello!'
})
await sock.sendMessage(jid, {
audio: { url: './audio.mp3' },
mimetype: 'audio/mpeg'
})
await sock.sendMessage(jid, {
document: { url: './document.pdf' },
mimetype: 'application/pdf',
fileName: 'document.pdf'
})
await sock.sendMessage(jid, {
sticker: { url: './sticker.webp' }
})
Messages can be quoted when sending a response:
await sock.sendMessage(
jid,
{
text: 'This is a reply'
},
{
quoted: message
}
)
Incoming messages can be handled through messages.upsert:
sock.ev.on('messages.upsert', async ({ messages }) => {
for (const message of messages) {
console.log(message)
}
})
For example:
sock.ev.on('messages.upsert', async ({ messages }) => {
const msg = messages[0]
if (!msg.message) return
console.log(msg.message)
})
const metadata = await sock.groupMetadata(jid)
console.log(metadata)
const group = await sock.groupCreate('My Group', [
'1234567890@s.whatsapp.net'
])
await sock.groupParticipantsUpdate(
jid,
['1234567890@s.whatsapp.net'],
'add'
)
await sock.groupParticipantsUpdate(
jid,
['1234567890@s.whatsapp.net'],
'remove'
)
await sock.groupParticipantsUpdate(
jid,
['1234567890@s.whatsapp.net'],
'promote'
)
await sock.groupParticipantsUpdate(
jid,
['1234567890@s.whatsapp.net'],
'demote'
)
Presence can be updated using:
await sock.sendPresenceUpdate('available', jid)
Available presence values include:
available
unavailable
composing
recording
paused
For example:
await sock.sendPresenceUpdate('composing', jid)
await new Promise(resolve => setTimeout(resolve, 2000))
await sock.sendPresenceUpdate('paused', jid)
You can request information about a WhatsApp user:
const result = await sock.onWhatsApp('1234567890')
console.log(result)
const profilePicture = await sock.profilePictureUrl(
jid,
'image'
)
console.log(profilePicture)
Depending on the account and privacy settings, the profile picture may not be available.
You can subscribe to presence updates:
sock.ev.on('presence.update', (update) => {
console.log(update)
})
To indicate that the bot is typing:
await sock.sendPresenceUpdate('composing', jid)
Stop typing:
await sock.sendPresenceUpdate('paused', jid)
Messages can be marked as read:
await sock.readMessages([
message.key
])
Send a reaction to a message:
await sock.sendMessage(
jid,
{
react: {
text: '👍',
key: message.key
}
}
)
Remove a reaction:
await sock.sendMessage(
jid,
{
react: {
text: '',
key: message.key
}
}
)
For messages that can be deleted:
await sock.sendMessage(
jid,
{
delete: message.key
}
)
Depending on the message type and supported WhatsApp functionality:
await sock.sendMessage(
jid,
{
text: 'Edited message',
edit: message.key
}
)
Messages can be forwarded using the appropriate message structure:
await sock.sendMessage(
jid,
{
forward: message
}
)
The exact structure may vary depending on the message type and Baileys version.
Baileys supports sending different types of media, including:
Example:
await sock.sendMessage(jid, {
image: {
url: './image.jpg'
},
caption: 'Example image'
})
For remote media:
await sock.sendMessage(jid, {
image: {
url: 'https://example.com/image.jpg'
}
})
Media can be downloaded from received messages using the media download utilities provided by the library.
Example:
import {
downloadMediaMessage
} from '@ndikz/baileys'
const buffer = await downloadMediaMessage(
message,
'buffer',
{}
)
The exact download options depend on the message type and library version.
Buttons, list messages and native flow messages are sent through sendMessage as usual. This fork adds the biz (and, for private chats, bot) binary nodes needed for them to render, so you do not need to pass additionalNodes yourself.
Support for particular interactive formats can change as WhatsApp updates its protocol. Check the exported types for the currently supported structures.
richMenu sends quick-reply buttons or a carousel of cards, with an optional image header and an open-URL footer:
await sock.richMenu(jid, {
header: { title: 'Menu', image: { url: 'https://example.com/banner.png' } },
body: { title: 'Choose one', buttons: ['Option 1', 'Option 2'] },
footer: { text: 'Open website', url: 'https://example.com' }
})
Carousel / row of cards:
await sock.richMenu(jid, {
body: {
carousel: true, // or row: true
cards: [
{ title: 'Card 1', buttons: ['Select'] },
{ title: 'Card 2', buttons: ['Select'] }
]
}
})
await sock.sendHtml(jid, '<h1>Hello</h1>')
[!NOTE]
richMenuandsendHtmlrely on WhatsApp client behavior that is not officially documented, so they may stop working or render differently after a WhatsApp update.
These content types are handled by sendMessage in this fork and are not available in upstream. They are detected automatically from the content object.
await sock.sendMessage(jid, {
productMessage: {
title: 'Product name',
description: 'Description',
thumbnail: { url: './product.jpg' },
productId: '123',
retailerId: 'shop',
url: 'https://example.com',
body: 'Body text',
footer: 'Footer text',
priceAmount1000: 25000000,
currencyCode: 'IDR',
buttons: []
}
})
await sock.sendMessage(jid, {
orderMessage: {
orderTitle: 'Order #1',
message: 'Thanks for your order',
totalAmount1000: 50000000,
totalCurrencyCode: 'IDR',
itemCount: 2,
thumbnail: { url: './order.jpg' }
}
})
await sock.sendMessage(jid, {
requestPaymentMessage: {
amount: 10000000, // amount x 1000
currency: 'IDR', // default: IDR
from: '1234567890@s.whatsapp.net',
note: 'Payment note'
}
})
await sock.sendMessage(jid, {
eventMessage: {
name: 'Meetup',
description: 'Monthly meetup',
startTime: 1790000000,
endTime: 1790003600,
location: { degreesLatitude: -7.25, degreesLongitude: 112.75, name: 'Surabaya' }
}
})
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.
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).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.