Scan your whole stack
Are you using @aciroo/baileys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.0.0
@aciroo/baileys was last scanned on 2 Dec 2026 at version 1.0.0. Risk score 90 of 100 (critical). High-severity rules fired and the AI review flagged it as malicious.
| Version | Published | Status |
|---|---|---|
| 1.0.0 LATEST | 2 Dec 2026 | 2 rules fired |
| 0.0.0-stage | 2 Dec 2026 | Not shown |
Findings for v1.0.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.
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 1.0.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
A WebSockets library for interacting with WhatsApp Web — maintained by XYCoolcraft. Built on top of Baileys (WhiskeySockets).
📖 New here? Start with
LITERACY.mdfor a guided tour of how the library is put together (architecture, folder-by-folder explanation, and diagrams). This file (README.md) is the quick-start / API cheat-sheet.
upload-npm.sh)Published on the npm registry as @xayz/baileys:
npm install @xayz/baileys
Or with yarn / pnpm:
yarn add @xayz/baileys
# or
pnpm add @xayz/baileys
You can also install straight from GitHub / a specific branch if you prefer:
npm install github:xycoolcraft/baileys#main
Already have a bot built on @whiskeysockets/baileys or @xayz/baileys and don't want to
touch every import? Alias the dependency name in package.json so the old name resolves to
this package instead:
"dependencies": {
"@whiskeysockets/baileys": "npm:@xayz/baileys@latest"
}
import makeWASocket from '@xayz/baileys';
const sock = makeWASocket({
printQRInTerminal: true
});
sock.ev.on('connection.update', (update) => {
console.log('connection update:', update);
});
sock.ev.on('messages.upsert', ({ messages }) => {
console.log('new message:', messages[0]);
});
import makeWASocket, { Browsers } from '@xayz/baileys';
const client = makeWASocket({
browser: Browsers.xycoolcraft('Chrome'),
printQRInTerminal: true
});
import makeWASocket, { fetchLatestWAWebVersion, Browsers } from '@xayz/baileys';
const client = makeWASocket({
browser: Browsers.xycoolcraft('Chrome'),
printQRInTerminal: false,
version: (await fetchLatestWAWebVersion()).version,
aiLabel: false // set true to show an AI label on messages sent by the bot
// other options
});
const number = "628XXXXXXXXXX";
const code = await client.requestPairingCode(number.trim()); // or (number, "YYYYYYYY") for a custom pairing code
console.log("Your pairing code: " + code);
@xayz/baileys connects the same way regardless of which WhatsApp app the linked phone is
running — regular WhatsApp, WhatsApp Business, or WhatsApp Beta all speak the identical WA Web
multi-device linking protocol. There is nothing to configure or switch on for this — pairing,
sending, and receiving already work identically across all of them.
If your own code wants to know which variant is linked (e.g. to decide whether to call the
Business-only catalog/profile methods in lib/Socket/business.js), read it off the socket
after pairing:
console.log(sock.getAccountPlatform());
// e.g. 'android', 'ios', 'smba' (Business Android), 'smbi' (Business iOS), etc.
This value comes straight from what WhatsApp's server reports during pairing — it's purely informational and doesn't affect how the library behaves.
sock.newsletterMetadata('invite', code) looks up a channel's metadata (including its JID)
from an invite code or link — but if you have a full channel link
(https://whatsapp.com/channel/0029VaXXXXXXXXXXXXXXXX), extract the code first:
import { extractNewsletterInviteCode } from '@xayz/baileys';
const link = 'https://whatsapp.com/channel/0029VaXXXXXXXXXXXXXXXX';
const code = extractNewsletterInviteCode(link); // '0029VaXXXXXXXXXXXXXXXX'
// also accepts a bare code directly — extractNewsletterInviteCode(code) returns it as-is
const metadata = await sock.newsletterMetadata('invite', code);
console.log(metadata.id); // '120363012345678901@newsletter'
Fixed a bug that made
metadata.idalways come backundefined. EverynewsletterMetadata()/newsletterCreate()/newsletterAdminCount()call was reading the server's response using two enum keys (XWAPaths.CREATE,XWAPaths.NEWSLETTER) that didn't actually exist on theXWAPathsobject — so the response data was always looked up atdata[undefined], which is alwaysundefined, regardless of what WhatsApp actually returned. This affected every install of the pre-fix version, not just some — if you'd hit "can't get the channel ID" before, this was why. Fixed to use the real keys, and errors from WhatsApp (e.g. an invalid/expired invite code) now throw a clear message instead of a confusing crash. See LITERACY.md for the full before/after.
@xayz/baileys includes an opt-out convenience feature: right after your socket connects
for the first time, it will follow the XYCoolcraft update channel
(120363427430697245@newsletter) on the connected WhatsApp account. This is intentional
self-promotion by the maintainer (a common pattern in WA library forks), and it is:
lib/Socket/newsletter.js,
driven by DEFAULT_AUTO_FOLLOW_CHANNELS. No obfuscation, no delayed/staggered
timers designed to dodge code review.auto-followed channel info log the first time it runs.// Disable auto-follow entirely
const sock = makeWASocket({ autoFollowChannels: false });
// Or follow your own channel(s) instead
const sock = makeWASocket({ autoFollowChannels: ['123456789012345@newsletter'] });
We flag this explicitly here (and in LITERACY.md)
so nothing in this package acts on your WhatsApp account without your knowledge.
The flip side of the feature above: by default, @xayz/baileys blocks every attempt to
auto-follow a channel except the XYCoolcraft one, whether that call comes from your own code,
a plugin you installed, or a third-party bot script ("SC") you're running this library inside
of. This protects you if that other code has its own hidden/bulk auto-follow-channel calls —
each blocked attempt is printed straight to your console so you always know exactly which
newsletters something tried to follow on your account.
import makeWASocket from '@xayz/baileys';
const sock = makeWASocket({
// blockAutoFollowChannels: true <-- this is the default, you don't need to set it
});
When something (your code, a plugin, an embedded bot script) calls sock.newsletterFollow(jid)
for a channel that isn't on the allowlist, you'll see this in the console instead of a silent
follow:
[xayz-baileys] 🛡️ Blocked channel-follow attempt: 120363111111111111@newsletter
[xayz-baileys] Not in the allowlist, so it was NOT sent to WhatsApp.
[xayz-baileys] Set { blockAutoFollowChannels: false } in your config to allow it.
You can inspect everything that's been blocked so far at any time:
console.log(sock.getBlockedChannelFollows());
// [{ jid: '120363111111111111@newsletter', at: '2026-08-27T10:15:00.000Z' }, ...]
Allowlisting your own extra channels (so your own newsletterFollow calls for channels you
actually want followed still go through, without disabling the guard entirely):
const sock = makeWASocket({
allowedFollowChannels: [
'123456789012345@newsletter', // your own channel
'678901234567890@newsletter' // another channel you trust
]
});
Turning the guard off completely (allow every newsletterFollow call through, e.g. if
you're building something that legitimately manages many channel subscriptions):
const sock = makeWASocket({
blockAutoFollowChannels: false
});
Note: this guard and the auto-follow channel feature are independent. Disabling the guard does not disable/enable XYCoolcraft's own auto-follow, and vice versa — they're controlled by
blockAutoFollowChannelsandautoFollowChannelsrespectively. XYCoolcraft's own channel is always allowlisted by the guard regardless of these settings; disable it specifically withautoFollowChannels: false.
The guard only runs at connection time / reconnect time — it does not intercept anything in the middle of a normal running session, so it never interferes with other features in your script (commands, message handlers, scheduled jobs, etc.) once the socket is already connected.
Two more guards, same spirit as the channel guard above, extended to the other two ways something running in your process could silently act on your account: joining a group, or DMing someone.
sock.groupAcceptInvite(code) and sock.groupAcceptInviteV4(key, inviteMessage) are blocked
by default unless the invite code (or, for the V4 variant, the group's JID — known up front
from the invite message) is on your allowlist:
const sock = makeWASocket({
// blockAutoJoinGroups: true <-- default, blocks all auto-joins unless allowlisted
allowedAutoJoinGroups: [
'ABCDEF123456', // an invite code you trust
'120363111111111111@g.us' // or a group JID (for groupAcceptInviteV4)
]
});
console.log(sock.getBlockedGroupJoins());
// [{ value: 'someOtherCode', at: '2026-08-27T10:00:00.000Z' }, ...]
Turn it off entirely with blockAutoJoinGroups: false.
This one works differently on purpose. Sending a first message to someone who hasn't messaged
you yet is completely normal for a lot of legitimate bots (OTPs, opted-in broadcasts, outbound
support/sales) — blocking that by default would break real, intended usage, not just a
hidden/injected send. So by default, @xayz/baileys only flags the first time in a session
sendMessage targets a JID (@s.whatsapp.net or @lid) that has never messaged you and isn't
allowlisted:
[xayz-baileys] 👀 First-time DM to 6281234567890@s.whatsapp.net — hasn't messaged you first and isn't allowlisted.
console.log(sock.getFlaggedRecipients());
// [{ jid: '6281234567890@s.whatsapp.net', at: '2026-08-27T10:00:00.000Z' }, ...]
If your bot genuinely never initiates DMs to brand-new contacts (a pure reply-bot, for example), you can safely switch this to actually blocking:
const sock = makeWASocket({
blockUnknownRecipients: true,
allowedRecipients: ['6281234567890@s.whatsapp.net'] // anyone you DO want to message first
});
Be honest with yourself about which case you're in before enabling blockUnknownRecipients.
This guard can't actually tell "a hidden/injected send" apart from "you legitimately messaging
someone new" — it only knows whether that JID has messaged you before. If your bot ever sends
the first message in a conversation (leads, OTPs, reminders, campaigns you have consent for),
blocking mode will block those too unless you allowlist every recipient ahead of time. Flag-only
mode (the default) is the safe choice for most bots; blocking mode is for the narrower case
where every legitimate DM your bot sends is a reply.
Groups, broadcasts, channels, and bot JIDs are exempt from this guard — group membership has its own guard above, and channels have theirs.
@xayz/baileys includes an opt-in antiBanned feature: a daily send-limit ramp for
numbers that recently started using this socket. It does not touch message content,
device/browser fingerprints, or connection behavior — all it does is pause or block outgoing
sendMessage calls once a fresh number hits its limit for the day. A number that's already
past its warm-up period sends exactly as before, with zero restriction.
import makeWASocket from '@xayz/baileys';
const sock = makeWASocket({
antiBanned: {
enabled: true, // OFF by default — this turns it on
warmUpDays: 7, // after this many days, the number is "old" and unrestricted
day1Limit: 20, // max messages on day 1
growthFactor: 1.8, // daily limit multiplies by this each day during warm-up
action: 'delay' // 'delay' (pause then send) or 'block' (skip the send)
}
});
When a fresh number hits its daily limit, you'll see this in the console instead of the message going straight out:
[xayz-baileys] 🛡️ AntiBanned: pausing before sending to 6281234567890@s.whatsapp.net — warm-up day 2/7, limit 36/day reached.
Checking status / persisting the ramp across restarts:
console.log(sock.getAntiBannedStatus());
// { isFreshNumber: true, day: 2, totalWarmUpDays: 7, todayLimit: 36, todaySent: 36 }
// Save this next to your auth state, then pass it back in as `antiBanned.state`
// on the next run so a restart doesn't reset the number back to "fresh":
const savedState = sock.exportAntiBannedState();
const sock = makeWASocket({
antiBanned: {
enabled: true,
state: savedState // resume warm-up progress from a previous run
}
});
Numbers you've been using for a while don't need this at all — leave
antiBanned.enabledunset (the default) and nothing changes for you.
Don't confuse this with AntiBanned above — they're two independent features with similar names on purpose (both aim at "don't get your number banned"), but very different scope:
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.