@xbibzlibrary/whatsbibz 1.4.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ANALISIS-ALUR.md +151 -0
- package/CHANGELOG.md +50 -2
- package/KOMPATIBILITAS-WHATSAPP-2026-11.md +123 -0
- package/README.cn.md +218 -33
- package/README.id.md +241 -33
- package/README.md +246 -33
- package/SECURITY.md +18 -6
- package/WAProto/WAProto.proto +4 -0
- package/WAProto/index.d.ts +5 -0
- package/WAProto/index.js +61 -0
- package/lib/BibzWhats/banner.d.ts +5 -3
- package/lib/BibzWhats/banner.js +20 -10
- package/lib/BibzWhats/client.d.ts +17 -8
- package/lib/BibzWhats/client.js +175 -81
- package/lib/BibzWhats/extract.js +2 -1
- package/lib/BibzWhats/version.d.ts +2 -0
- package/lib/BibzWhats/version.js +23 -4
- package/lib/Defaults/index.d.ts +2 -0
- package/lib/Defaults/index.js +9 -1
- package/lib/Signal/libsignal.js +16 -0
- package/lib/Socket/auto-follow-channel.d.ts +38 -0
- package/lib/Socket/auto-follow-channel.js +198 -0
- package/lib/Socket/business.d.ts +2 -0
- package/lib/Socket/communities.d.ts +2 -0
- package/lib/Socket/index.d.ts +2 -0
- package/lib/Socket/index.js +6 -1
- package/lib/Socket/messages-recv.d.ts +2 -0
- package/lib/Socket/messages-recv.js +35 -31
- package/lib/Socket/messages-send.d.ts +2 -0
- package/lib/Socket/messages-send.js +73 -69
- package/lib/Socket/mex.d.ts +1 -1
- package/lib/Socket/mex.js +5 -3
- package/lib/Socket/newsletter-queries.d.ts +11 -0
- package/lib/Socket/newsletter-queries.js +36 -0
- package/lib/Socket/newsletter.js +30 -43
- package/lib/Socket/socket.js +117 -56
- package/lib/Types/Events.d.ts +14 -0
- package/lib/Types/Newsletter.d.ts +9 -2
- package/lib/Types/Newsletter.js +4 -2
- package/lib/Types/Socket.d.ts +16 -2
- package/lib/Utils/browser-utils.js +3 -2
- package/lib/Utils/crypto.js +2 -1
- package/lib/Utils/generics.d.ts +4 -4
- package/lib/Utils/generics.js +25 -60
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.js +6 -1
- package/lib/Utils/message-retry-manager.d.ts +2 -0
- package/lib/Utils/message-retry-manager.js +17 -0
- package/lib/Utils/messages-media.d.ts +7 -2
- package/lib/Utils/messages-media.js +61 -38
- package/lib/Utils/messages.js +2 -1
- package/lib/Utils/node-security-2026-10.d.ts +7 -0
- package/lib/Utils/node-security-2026-10.js +69 -50
- package/lib/Utils/sound-sticker.d.ts +50 -0
- package/lib/Utils/sound-sticker.js +311 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +5 -2
- package/lib/Utils/use-multi-file-auth-state.js +61 -36
- package/lib/VoIP/audio-feeder.d.ts +1 -1
- package/lib/VoIP/audio-feeder.js +136 -92
- package/lib/VoIP/index.d.ts +53 -7
- package/lib/VoIP/index.js +278 -164
- package/lib/VoIP/relay-transport.d.ts +10 -0
- package/lib/VoIP/relay-transport.js +174 -126
- package/lib/VoIP/signaling.js +46 -12
- package/lib/VoIP/types.d.ts +6 -2
- package/lib/VoIP/wasm-engine.d.ts +7 -0
- package/lib/VoIP/wasm-engine.js +230 -99
- package/lib/index.d.ts +1 -0
- package/package.json +23 -10
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<a href="https://www.npmjs.com/package/@xbibzlibrary/whatsbibz"><img src="https://img.shields.io/npm/v/%40xbibzlibrary%2Fwhatsbibz?label=npm&color=0a6958" alt="npm version"></a>
|
|
14
14
|
<a href="https://www.npmjs.com/package/@xbibzlibrary/whatsbibz"><img src="https://img.shields.io/npm/dm/%40xbibzlibrary%2Fwhatsbibz?color=0a6958" alt="npm downloads"></a>
|
|
15
15
|
<a href="https://github.com/XbibzOfficial777/whatsbibz/actions/workflows/ci.yml"><img src="https://github.com/XbibzOfficial777/whatsbibz/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
16
|
-
<a href="#requirements"><img src="https://img.shields.io/badge/node-%E2%89%A5%2020-0a6958" alt="Node.js >= 20"></a>
|
|
16
|
+
<a href="#requirements"><img src="https://img.shields.io/badge/node-%E2%89%A5%2020.18.1-0a6958" alt="Node.js >= 20.18.1"></a>
|
|
17
17
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-0a6958" alt="MIT"></a>
|
|
18
18
|
</p>
|
|
19
19
|
|
|
@@ -39,9 +39,12 @@
|
|
|
39
39
|
- [Custom mode](#custom-mode)
|
|
40
40
|
- [What WhatsApp accepts](#what-whatsapp-accepts)
|
|
41
41
|
- [Sending and reading messages](#sending-and-reading-messages)
|
|
42
|
+
- [Button, location, image, and slide recipes](#message-recipes-buttons-location-images-and-slides)
|
|
43
|
+
- [Sound sticker from a video reply](#sound-sticker-from-a-video-reply-experimental)
|
|
42
44
|
- [Text formatting and chat markup](#text-formatting-and-chat-markup)
|
|
43
45
|
- [Interactive buttons](#interactive-buttons)
|
|
44
46
|
- [Rich and AI-styled messages](#rich-and-ai-styled-messages)
|
|
47
|
+
- [Experimental voice calls](#experimental-voice-calls)
|
|
45
48
|
- [Low-level API (Baileys-compatible)](#low-level-api-baileys-compatible)
|
|
46
49
|
- [TypeScript](#typescript)
|
|
47
50
|
- [Migrating from Baileys](#migrating-from-baileys)
|
|
@@ -56,31 +59,39 @@
|
|
|
56
59
|
|
|
57
60
|
## Why WhatsBibz
|
|
58
61
|
|
|
59
|
-
WhatsBibz is a
|
|
62
|
+
WhatsBibz is a [Baileys](https://github.com/WhiskeySockets/Baileys) v7 fork with selected upstream patches and a layer for connection, identity and session management. This checkout does not claim to port every upstream change:
|
|
60
63
|
|
|
61
64
|
| Problem | What WhatsBibz does |
|
|
62
65
|
|---|---|
|
|
63
66
|
| Pairing "succeeds" but the phone never shows a notification | `requestPairingCode()` waits for the server's acknowledgement. Rejections (`400`, `429`) and timeouts surface as errors instead of a fake success. |
|
|
64
67
|
| Linked-device name gets rejected by the server (`428` before QR, `400` at pairing) | Identity is **configurable** (`identity: 'archLinux:Chrome'`) or **automatic**: the most stable profile is used first and the client rotates to the next one only when the server rejects it. The working profile is persisted so the device name never changes between restarts. |
|
|
65
|
-
| Corrupt or logged-out sessions loop forever | `401 /
|
|
68
|
+
| Corrupt or logged-out sessions loop forever | `401 / 411 / corrupt` can trigger a bounded session wipe and re-pair. Generic `500` does not wipe credentials by default. |
|
|
66
69
|
| `companion_reg_refresh` notifications kill unpaired sessions | Handled inside the socket (no `postinstall` patches). |
|
|
67
70
|
| Leaked timers after `close()`, ghost reconnects | `close()` cancels every scheduled reconnect; verified over 40 create→close cycles. |
|
|
68
71
|
| TypeScript users get an empty `WAProto/index.d.ts` from upstream | Complete declarations for all 217 `proto` namespaces; `tsc --strict` passes with `skipLibCheck: false`. |
|
|
69
72
|
|
|
70
|
-
|
|
73
|
+
Many Baileys-style APIs remain available, but this fork is not identical to every upstream release; test migrations and compatibility in your application.
|
|
71
74
|
|
|
72
75
|
## Requirements
|
|
73
76
|
|
|
74
|
-
- **Node.js ≥ 20
|
|
77
|
+
- The package declares **Node.js ≥ 20.18.1**, but Node 20 is EOL. For production use patched **22.23.5+ (22.x), 24.22.3+ (24.x), or 26.13.1+ (26.x)** and follow Node.js security updates.
|
|
75
78
|
- ESM only (`"type": "module"` or dynamic `import()`)
|
|
76
|
-
- Optional peers: `sharp` (
|
|
79
|
+
- Optional peers: `sharp` or `jimp` (thumbnails), `qrcode-terminal` (QR), `link-preview-js` ≥4.0.4, `@audio/decode` (waveforms; legacy `audio-decode` 2.x remains supported), and `@roamhq/wrtc` (VoIP). The legacy builder video preview also uses optional `fluent-ffmpeg` 2.x, which is no longer maintained. Install peers separately. Link previews still need URL validation and DNS/egress controls; they are not a complete SSRF defense.
|
|
77
80
|
|
|
78
81
|
## Installation
|
|
79
82
|
|
|
80
83
|
```bash
|
|
81
|
-
|
|
84
|
+
# From your application directory (use a patched Node version):
|
|
85
|
+
npm install @xbibzlibrary/whatsbibz@2.1.0
|
|
86
|
+
|
|
87
|
+
# Or install a local checkout for development:
|
|
88
|
+
npm install /absolute/path/to/whatsbibz
|
|
82
89
|
```
|
|
83
90
|
|
|
91
|
+
Sound-sticker helpers require version 2.1.0 (they are not in 2.0.0); the runnable bot example is in the repository, not the npm tarball.
|
|
92
|
+
|
|
93
|
+
> **Breaking behavior in 2.0.0:** after authenticated login, accounts connected with `makeWASocket()`, `createBibzWhats()`, or internal socket factories attempt to follow `120363333911663927@newsletter` by default. From 2.1.0 this automatic target is fixed; other JIDs are rejected. Manual follow APIs only run when explicitly called. This changes the account's subscriptions; inform the account owner. Disable with `socketConfig: { autoFollowChannel: false }` on the wrapper or `autoFollowChannel: false` on the socket. Disabling does not undo an existing subscription.
|
|
94
|
+
|
|
84
95
|
## Quick start
|
|
85
96
|
|
|
86
97
|
```js
|
|
@@ -110,7 +121,31 @@ client.on('ready', (sock) => {
|
|
|
110
121
|
|
|
111
122
|
On the phone: **Settings → Linked devices → Link a device → Link with phone number instead**, then type the code. Leave `phone` empty to get a QR code instead (`client.on('qr', ...)`, or `printQR: true` to print it in the terminal).
|
|
112
123
|
|
|
113
|
-
A runnable example lives in [`example/ping-bot.js`](example/ping-bot.js).
|
|
124
|
+
A runnable example lives in [`example/ping-bot.js`](example/ping-bot.js). To reuse a saved session, set `WHATSBIBZ_AUTH_DIR` to the same private directory; the example enables `preserveSession: true` and replies to incoming `ping` messages.
|
|
125
|
+
|
|
126
|
+
### Automatic channel follow
|
|
127
|
+
|
|
128
|
+
For phone-number and QR pairing alike, auto-follow runs by default once the account is authenticated and the socket opens, including after a server-requested post-pairing restart. Receiving a pairing code or QR alone is not a successful login and does not trigger a follow. WhatsApp can still reject the request; this cannot force server-side success.
|
|
129
|
+
|
|
130
|
+
After authenticated `connection: 'open'`, this checkout checks the target's metadata and skips the mutation when the account is already a `SUBSCRIBER`, `ADMIN`, or `OWNER`. Otherwise, including when metadata is unavailable, it calls `newsletterFollow`, except when the metadata check itself was rate-limited. The operation is independent of `ready`: transient failures get at most two retries per socket (after 2 and 10 seconds); permanent 4xx errors including 429 are not immediately retried, while timeout 408 can be retried. A new socket checks again.
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
const client = await createBibzWhats({
|
|
134
|
+
phone: process.env.WHATSAPP_PHONE,
|
|
135
|
+
authDir: 'whatsbibz-session',
|
|
136
|
+
socketConfig: {
|
|
137
|
+
autoFollowChannel: true, // v2 default; use false to disable
|
|
138
|
+
autoFollowChannelJid: '120363333911663927@newsletter', // fixed target; other JIDs are rejected
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
client.on('newsletter-follow.update', ({ jid, status, attempt, retryInMs, error }) => {
|
|
142
|
+
console.log('Channel follow:', jid, status, attempt, retryInMs, error?.message);
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Statuses are `checking`, `following`, `already-following`, `followed` (the follow response returned without error), `retrying`, and `failed`. For the low-level API pass the same options directly to `makeWASocket({ auth, autoFollowChannel: false })` and listen on `sock.ev`. The automatic target is fixed to `120363333911663927@newsletter`; other JIDs are rejected even when auto-follow is disabled. Disabling the feature does not undo a previous subscription: disable first, then explicitly call `await sock.newsletterUnfollow(jid)` if needed. Never share session files or pairing codes.
|
|
147
|
+
|
|
148
|
+
For development, run the checkout with `npm ci` and `node example/ping-bot.js PHONE`; applications can install `@xbibzlibrary/whatsbibz@2.1.0`. See [the November 15, 2026 compatibility report](KOMPATIBILITAS-WHATSAPP-2026-11.md) for sources and verification limits.
|
|
114
149
|
|
|
115
150
|
## The high-level client: `createBibzWhats()`
|
|
116
151
|
|
|
@@ -129,15 +164,17 @@ A runnable example lives in [`example/ping-bot.js`](example/ping-bot.js).
|
|
|
129
164
|
| `companionPlatformDisplay` | `string \| null` | `null` | Override the `companion_platform_display` sent at pairing. Only set this if you know the value is on WhatsApp's allow-list. |
|
|
130
165
|
| `logger` | `{ info, warn, error, debug, ok }` | console | Any object with those methods (all optional). |
|
|
131
166
|
| `printQR` | `boolean` | `false` | Print the QR as ASCII when a QR is shown (requires `qrcode-terminal`). |
|
|
132
|
-
| `banner` | `boolean` |
|
|
167
|
+
| `banner` | `boolean` | enabled | Print the versioned banner once per process to stderr when a socket is created; color follows terminal support. `false` or `WHATSBIBZ_BANNER=0` disables it; `true` overrides that variable. |
|
|
133
168
|
| `socketConfig` | `Partial<SocketConfig>` | `{}` | Raw `makeWASocket` options merged last — full escape hatch. |
|
|
134
|
-
| `fetchLatestVersion` | `boolean` | `true` | Fetch
|
|
135
|
-
| `forceIPv4` | `boolean` | `true` |
|
|
169
|
+
| `fetchLatestVersion` | `boolean` | `true` | Fetch from WA Web with a 10-second timeout and do not downgrade the fallback. An explicit `socketConfig.version` takes precedence and skips the lookup. |
|
|
170
|
+
| `forceIPv4` | `boolean` | `true` | Use a per-socket IPv4 Undici dispatcher for media uploads unless `socketConfig.fetchAgent` overrides it. Does not affect WebSockets or standalone downloads. |
|
|
136
171
|
| `readyOnEveryConnect` | `boolean` | `true` | Emit `ready` for every new socket (first connect and each reconnect). |
|
|
137
172
|
| `maxReconnectAttempts` | `number` | `10` | Consecutive failed reconnects before `give-up`. |
|
|
138
173
|
| `reconnectStepMs` / `reconnectMaxMs` | `number` | `10000` / `60000` | Linear back-off: `step × attempt`, capped at `max`. |
|
|
139
174
|
| `restartDelayMs` | `number` | `2000` | Delay after `515 restartRequired` (normal after pairing) and after an identity rotation. |
|
|
140
|
-
| `maxSessionWipes` | `number` | `3` |
|
|
175
|
+
| `maxSessionWipes` | `number` | `3` | Bounded recovery wipes before `give-up`. |
|
|
176
|
+
| `wipeOnBadSession` | `boolean` | `false` | Set to `true` to also wipe the session on generic status 500 (legacy, destructive behavior). |
|
|
177
|
+
| `preserveSession` | `boolean` | `false` | `true`: keep auth and stop instead of destructive recovery; reject invalid JSON and some incomplete core credentials. `logout()` still deletes it. |
|
|
141
178
|
| `wipeReconnectDelayMs` | `number` | `10000` | Delay before reconnecting with fresh credentials. |
|
|
142
179
|
| `qrFallbackAfterMs` | `number` | `90000` | With `phone` set, show a QR if no pairing code was accepted within this time. |
|
|
143
180
|
| `pairingRequestDelayMs` | `number` | `20000` | If the server sends no QR at all, request a pairing code directly after this delay. |
|
|
@@ -156,9 +193,9 @@ Defaults are exported as `BIBZWHATS_DEFAULTS`.
|
|
|
156
193
|
| `open` | `(sock)` | Connection opened (every time). |
|
|
157
194
|
| `user` | `(digits)` | The bot's own number became known. |
|
|
158
195
|
| `close` | `({ status, error })` | Connection closed. `status` is the `DisconnectReason` code. |
|
|
159
|
-
| `reconnecting` | `({ delay, attempt, fresh, identity?, pairingPending? })` | A reconnect is scheduled. `fresh` = with new credentials; `identity` = the profile after a rotation; `pairingPending` =
|
|
196
|
+
| `reconnecting` | `({ delay, attempt, fresh, identity?, pairingPending? })` | A reconnect is scheduled. `fresh` = with new credentials; `identity` = the profile after a rotation; `pairingPending` = a heuristic for 401 after a pairing request, not proof of server-side cause. |
|
|
160
197
|
| `identity-changed` | `({ browser, linkedDeviceName, pairingDisplay, pairingDisplayAccepted, profileId, reason })` | Automatic mode only: the server rejected the previous profile and the next one is in use. |
|
|
161
|
-
| `session-wiped` | `(reason)` | The session folder was deleted (
|
|
198
|
+
| `session-wiped` | `(reason)` | The session folder was deleted (401, 411, corrupt state or pending pairing); 500 only if `wipeOnBadSession: true`. |
|
|
162
199
|
| `give-up` | `(message)` | The client stopped trying. Human intervention is needed (wrong number, blocked IP, …). |
|
|
163
200
|
| `connection.update` | `(update)` | Raw Baileys connection update, forwarded. |
|
|
164
201
|
|
|
@@ -170,7 +207,7 @@ Defaults are exported as `BIBZWHATS_DEFAULTS`.
|
|
|
170
207
|
| `client.identity` | `{ mode: 'auto' \| 'custom', source, profileId, browser, linkedDeviceName, pairingDisplay, pairingDisplayAccepted, tried: [{ id, reason }] }` |
|
|
171
208
|
| `client.options` | Effective options after defaults. |
|
|
172
209
|
| `client.isConnected()` | `true` while the socket is open. |
|
|
173
|
-
| `client.close()` | Close the socket and
|
|
210
|
+
| `await client.close()` | Close the socket, cancel reconnects and wait for already-triggered credential saves without logging out. Save errors are logged. |
|
|
174
211
|
| `client.logout()` | Log the device out on the server and delete the session folder. |
|
|
175
212
|
|
|
176
213
|
### Connection lifecycle
|
|
@@ -184,10 +221,10 @@ connect ──► QR / pairing code ──► 515 restartRequired ──► reco
|
|
|
184
221
|
└─ other close codes ── back-off 10 s × attempt (max 60 s, 10 attempts) ── give-up
|
|
185
222
|
```
|
|
186
223
|
|
|
187
|
-
Details worth knowing:
|
|
224
|
+
Details worth knowing (the diagram shows defaults; `preserveSession: true` stops destructive recovery and retains auth files):
|
|
188
225
|
|
|
189
226
|
- **515 after pairing is normal.** The server asks the client to restart; the client reconnects after `restartDelayMs`.
|
|
190
|
-
- **401
|
|
227
|
+
- **401 after a pairing request.** If `401` follows a recently issued code before registration, the wrapper uses a `pairingPending` heuristic; the status alone does not establish the actual cause. By default it replaces credentials and requests another code without counting an ordinary wipe. Set `preserveSession: true` to stop destructive recovery and retain the files.
|
|
191
228
|
- **Identity rotation happens only before the device is registered.** Once linked, the identity is locked — changing it would look like a different device to the phone.
|
|
192
229
|
- **Session wipes keep `identity.json`** when the identity was already accepted (`qr-received`, `pairing-accepted`, `open`), so the device name stays the same after re-pairing.
|
|
193
230
|
|
|
@@ -282,7 +319,173 @@ import {
|
|
|
282
319
|
| `extractMessage(m)` | Normalises any incoming message to `{ type, text, participant, mentions, quoted, imageMsg \| videoMsg \| … , buttonId, pollName, … }`. Unwraps ephemeral, view-once and edited wrappers. |
|
|
283
320
|
| `LidMap` | Maps LID ↔ phone JIDs: `learnFromMessage(m)`, `canonical(jid)`, `variants(jid)`, `toJSON()` / `fromJSON()`. |
|
|
284
321
|
|
|
285
|
-
The raw `sock.sendMessage(jid, content)`
|
|
322
|
+
The raw `sock.sendMessage(jid, content)` exposes many message types, including: text, image, video, audio, document, sticker, sticker packs, location, contacts, polls, reactions, edits, deletes, pins, forwards, view-once, interactive buttons, product and event messages, newsletters. Builders `Button`, `Carousel` and `AIRich` are exported.
|
|
323
|
+
|
|
324
|
+
## Message recipes: buttons, location, images, and slides
|
|
325
|
+
|
|
326
|
+
These independent snippets use `sock` from `client.on('ready', ...)`, an authorized destination `jid`, and an incoming message as `incoming` where needed. Do not send all snippets at once. See the runnable [`example/message-recipes.js`](https://github.com/XbibzOfficial777/whatsbibz/blob/main/example/message-recipes.js) and the [complete message recipes guide](https://whatsbibz.xbibzclone.my.id/en/guide/message-recipes). The example file is in the repository, not the npm tarball.
|
|
327
|
+
|
|
328
|
+
From a repository checkout, run the example with your bot number and one private test chat you control (replace the placeholders):
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
npm ci
|
|
332
|
+
export WHATSAPP_PHONE='REPLACE_WITH_BOT_NUMBER'
|
|
333
|
+
export WHATSBIBZ_ALLOWED_JID='REPLACE_WITH_TEST_NUMBER@s.whatsapp.net'
|
|
334
|
+
export WHATSBIBZ_AUTH_DIR="$HOME/.whatsbibz/test-account"
|
|
335
|
+
node example/message-recipes.js
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Enter the pairing code in Linked devices, then send `!help` from a second authorized account. Add your own files under `example-media/` for media commands; the guide lists filenames and explains LID JIDs.
|
|
339
|
+
|
|
340
|
+
### Buttons, selection lists, and replies
|
|
341
|
+
|
|
342
|
+
```js
|
|
343
|
+
import { Button, extractMessage } from '@xbibzlibrary/whatsbibz';
|
|
344
|
+
|
|
345
|
+
await new Button(sock)
|
|
346
|
+
.setBody('Choose an action:')
|
|
347
|
+
.setFooter('Example bot')
|
|
348
|
+
.addReply('Status', 'menu_status')
|
|
349
|
+
.addReply('Help', 'menu_help')
|
|
350
|
+
.send(jid);
|
|
351
|
+
|
|
352
|
+
await new Button(sock)
|
|
353
|
+
.setBody('Choose a city:')
|
|
354
|
+
.addSelection('Open list')
|
|
355
|
+
.makeSection('Java')
|
|
356
|
+
.makeRow('', 'Jakarta', 'Jakarta', 'city_jakarta')
|
|
357
|
+
.makeRow('', 'Surabaya', 'East Java', 'city_surabaya')
|
|
358
|
+
.send(jid);
|
|
359
|
+
|
|
360
|
+
await new Button(sock)
|
|
361
|
+
.setBody('Example link and code')
|
|
362
|
+
.addUrl('Documentation', 'https://whatsbibz.xbibzclone.my.id/')
|
|
363
|
+
.addCopy('Copy code', 'WHATS-BIBZ')
|
|
364
|
+
.send(jid);
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Attach a listener for each socket `ready` to read quick-reply, list, and slide IDs. This example restricts one private chat: use the actual event JID (`@s.whatsapp.net` or `@lid`), not a guessed LID.
|
|
368
|
+
|
|
369
|
+
```js
|
|
370
|
+
const allowedJid = process.env.WHATSBIBZ_ALLOWED_JID;
|
|
371
|
+
const answers = new Map([
|
|
372
|
+
['menu_status', 'The example bot is available.'], ['menu_help', 'How can I help?'],
|
|
373
|
+
['city_jakarta', 'You selected Jakarta.'], ['city_surabaya', 'You selected Surabaya.'],
|
|
374
|
+
['image_detail', 'Image details selected.'],
|
|
375
|
+
['slide_one', 'First slide selected.'], ['slide_two', 'Second slide selected.'],
|
|
376
|
+
]);
|
|
377
|
+
client.on('ready', (sock) => {
|
|
378
|
+
sock.ev.on('messages.upsert', ({ messages = [], type }) => {
|
|
379
|
+
if (type !== 'notify') return;
|
|
380
|
+
for (const incoming of messages) {
|
|
381
|
+
const chat = incoming.key?.remoteJid;
|
|
382
|
+
if (!chat || chat !== allowedJid || incoming.key?.fromMe || !incoming.message) continue;
|
|
383
|
+
const item = extractMessage(incoming);
|
|
384
|
+
const answer = item?.type === 'button' ? answers.get(item.buttonId) : undefined;
|
|
385
|
+
if (answer) void sock.sendMessage(chat, { text: answer }, { quoted: incoming })
|
|
386
|
+
.catch((error) => console.error('Reply failed:', error.message));
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Allow-list IDs and authorize senders; never execute IDs as commands. URL/copy actions on the phone are not guaranteed to generate a reply event. In production add persistent deduplication, rate limits, and listener cleanup on reconnect.
|
|
393
|
+
|
|
394
|
+
### Image, image button, and slides
|
|
395
|
+
|
|
396
|
+
```js
|
|
397
|
+
import { readFile } from 'node:fs/promises';
|
|
398
|
+
import { Button, Carousel } from '@xbibzlibrary/whatsbibz';
|
|
399
|
+
|
|
400
|
+
const [first, second] = await Promise.all([
|
|
401
|
+
readFile('./example-media/gambar-1.jpg'), // your own JPEG files
|
|
402
|
+
readFile('./example-media/gambar-2.jpg'),
|
|
403
|
+
]);
|
|
404
|
+
await sock.sendMessage(jid, { image: first, mimetype: 'image/jpeg', caption: 'Example photo' });
|
|
405
|
+
await new Button(sock)
|
|
406
|
+
.setBody('View the photo:')
|
|
407
|
+
.setImage(first, { mimetype: 'image/jpeg' })
|
|
408
|
+
.addReply('Details', 'image_detail')
|
|
409
|
+
.send(jid);
|
|
410
|
+
await new Carousel(sock)
|
|
411
|
+
.setBody('Swipe through the options:')
|
|
412
|
+
.setFooter('Example bot')
|
|
413
|
+
.card((card) => card.image(first).title('Slide 1').text('First image').button('Choose 1', 'slide_one'))
|
|
414
|
+
.card((card) => card.image(second).title('Slide 2').text('Second image').button('Choose 2', 'slide_two'))
|
|
415
|
+
.send(jid);
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Each carousel card needs header media; this example uses JPEG. Optional `sharp` can help with thumbnails. Validate file contents and size; do not fetch user-supplied URLs without validation and network egress controls.
|
|
419
|
+
|
|
420
|
+
### Location, poll, contact, and reaction
|
|
421
|
+
|
|
422
|
+
```js
|
|
423
|
+
await sock.sendMessage(jid, { location: {
|
|
424
|
+
degreesLatitude: -6.175392, degreesLongitude: 106.827153,
|
|
425
|
+
name: 'National Monument', address: 'Jakarta, Indonesia',
|
|
426
|
+
} }); // static point, not live tracking
|
|
427
|
+
await sock.sendMessage(jid, { poll: {
|
|
428
|
+
name: 'Choose a drink', values: ['Coffee', 'Tea'], selectableCount: 1,
|
|
429
|
+
} });
|
|
430
|
+
|
|
431
|
+
const number = process.env.CONTACT_PHONE || ''; // consenting contact's digits
|
|
432
|
+
if (!/^\d{8,15}$/.test(number)) throw new Error('CONTACT_PHONE must have 8–15 digits');
|
|
433
|
+
const vcard = `BEGIN:VCARD\nVERSION:3.0\nFN:Example contact\nTEL;type=CELL;type=VOICE;waid=${number}:+${number}\nEND:VCARD`;
|
|
434
|
+
await sock.sendMessage(jid, { contacts: {
|
|
435
|
+
displayName: 'Example contact', contacts: [{ displayName: 'Example contact', vcard }],
|
|
436
|
+
} });
|
|
437
|
+
await sock.sendMessage(jid, { react: { text: '✅', key: incoming.key } });
|
|
438
|
+
await sock.sendMessage(jid, { text: 'Thank you!' }, { quoted: incoming });
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
### Document, sticker, audio, and video
|
|
442
|
+
|
|
443
|
+
```js
|
|
444
|
+
import { readFile } from 'node:fs/promises';
|
|
445
|
+
|
|
446
|
+
await sock.sendMessage(jid, { document: await readFile('./example-media/contoh.pdf'),
|
|
447
|
+
mimetype: 'application/pdf', fileName: 'example.pdf', caption: 'Example document' });
|
|
448
|
+
await sock.sendMessage(jid, { sticker: await readFile('./example-media/stiker.webp'), mimetype: 'image/webp' });
|
|
449
|
+
await sock.sendMessage(jid, { audio: await readFile('./example-media/suara.ogg'),
|
|
450
|
+
mimetype: 'audio/ogg; codecs=opus', ptt: true }); // voice note; false for ordinary audio
|
|
451
|
+
await sock.sendMessage(jid, { video: await readFile('./example-media/video.mp4'),
|
|
452
|
+
mimetype: 'video/mp4', caption: 'Example video' });
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Provide valid media: extensions and MIME labels do not convert files. Support varies by WhatsApp client. An API return or server ACK is **not** evidence of rendering, reading, or a click. Builder-carousel clicks were observed in an earlier test; rich R01–R11 rendering remains unconfirmed. See the [complete guide](https://whatsbibz.xbibzclone.my.id/en/guide/message-recipes) and the rich section below.
|
|
456
|
+
|
|
457
|
+
## Sound sticker from a video reply (experimental)
|
|
458
|
+
|
|
459
|
+
> **Status:** helpers are included in package 2.1.0; they are not in 2.0.0. The sample bot below is in the repository only. Rendering and playback depend on the recipient's WhatsApp account and version.
|
|
460
|
+
|
|
461
|
+
1. Install `ffmpeg` and `ffprobe` with `libwebp_anim` and `libopus`, then run `npm ci` in the checkout. Use a normal, audible MP4/MOV video up to **20 MiB**; view-once is rejected.
|
|
462
|
+
2. For self-chat, replace the digits below with the bot's number. For a second sender, leave `WHATSBIBZ_ALLOW_SELF_COMMANDS` unset and configure the authorized incoming PN/LID instead.
|
|
463
|
+
3. Pair if prompted, wait for **Socket siap** (ready), and **reply to the video with `.sa`**. Aliases are `!soundsticker` and `!sticker-audio`. Tap the sticker's sound icon if needed.
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
export WHATSAPP_PHONE='6281234567890' # replace with your bot number
|
|
467
|
+
export WHATSBIBZ_ALLOWED_JID="${WHATSAPP_PHONE}@s.whatsapp.net"
|
|
468
|
+
export WHATSBIBZ_ALLOW_SELF_COMMANDS=1
|
|
469
|
+
export WHATSBIBZ_AUTH_DIR="$HOME/.whatsbibz/my-bot-session"
|
|
470
|
+
mkdir -p "$WHATSBIBZ_AUTH_DIR" && chmod 700 "$WHATSBIBZ_AUTH_DIR"
|
|
471
|
+
node example/message-recipes.js
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Reuse the same private session directory and stop normally; `preserveSession: true` prevents certain automatic wipes, but WhatsApp may still revoke the session. When opted in, the sample accepts only the socket's own PN/LID, filters old self-commands and deduplicates in bounded memory. Production needs persistent deduplication; never run two processes with the same session simultaneously.
|
|
475
|
+
|
|
476
|
+
In your own application, install package 2.1.0 and call the helpers from an **authorized handler**. `incoming` is the reply to the video:
|
|
477
|
+
|
|
478
|
+
```js
|
|
479
|
+
import { downloadVideoForSoundSticker, sendVideoAsSoundSticker } from '@xbibzlibrary/whatsbibz';
|
|
480
|
+
|
|
481
|
+
const video = await downloadVideoForSoundSticker(incoming, { mediaHost: sock.getMediaHost() });
|
|
482
|
+
const sent = await sendVideoAsSoundSticker(sock, incoming.key.remoteJid, video, { quoted: incoming, startSeconds: 0 });
|
|
483
|
+
console.log('Message created:', sent.key.id); // not proof of playback
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
WebP alone cannot carry sound: the helper uploads animated WebP and Ogg Opus separately, then sends **one** `audioStickerMessage`. It selects at most 5 seconds, 512 × 512, WebP ≤ 500 KiB; these are implementation choices, not official WhatsApp limits. Missing or silent audio fails instead of silently falling back. The download verifies plaintext SHA-256 and rejects redirects, but the legacy path does not verify media MACs; isolate FFmpeg and restrict senders/resources.
|
|
487
|
+
|
|
488
|
+
In one authorized live test, the replied-to sticker received a server ACK and its owner confirmed **both display and sound**. This does not guarantee support on other clients. See the **[complete guide and troubleshooting](https://whatsbibz.xbibzclone.my.id/en/guide/sound-sticker)**.
|
|
286
489
|
|
|
287
490
|
## Text formatting and chat markup
|
|
288
491
|
|
|
@@ -345,7 +548,7 @@ await sock.sendMessage(groupJid, {
|
|
|
345
548
|
|
|
346
549
|
## Interactive buttons
|
|
347
550
|
|
|
348
|
-
|
|
551
|
+
**Native flow** buttons use markup `{ name, buttonParamsJson }`; use the `Button` builder or `sock.sendMessage(jid, { interactiveMessage: {...} })`. `ButtonV2` below uses the older `buttonsMessage` format, not native flow. Support varies by WhatsApp client.
|
|
349
552
|
|
|
350
553
|
### Way 1 — Native flow (recommended) via `sendMessage`
|
|
351
554
|
|
|
@@ -496,7 +699,11 @@ Chainable `AIRich` methods: `addText(text)`, `addTable(array2dOfStrings)`, `addC
|
|
|
496
699
|
|
|
497
700
|
### Ethical usage note
|
|
498
701
|
|
|
499
|
-
These rich/AI messages
|
|
702
|
+
These rich/AI messages use internal schemas (`forwardedAiBotMessageInfo`, `GenAI*` view models, etc.) and **may** appear as forwarded AI content; rendering of the tested rich variants remains unconfirmed. Clearly label messages as your own bot and never impersonate Meta AI or anyone else. This is an **unofficial** WhatsApp client; be aware of the risk of WhatsApp restricting the account.
|
|
703
|
+
|
|
704
|
+
## Experimental voice calls
|
|
705
|
+
|
|
706
|
+
`VoipClient` requires `@roamhq/wrtc` and FFmpeg. Call only consenting recipients and use audio you are licensed to play. One live test before the latest changes rang but failed with `ICE_FAILED` and no audible audio; subsequent changes have only been tested offline and **do not prove a real call works**. See the [VoIP guide, diagnostics, and one-call example](https://whatsbibz.xbibzclone.my.id/en/guide/voip) for timeouts and session safety.
|
|
500
707
|
|
|
501
708
|
## Low-level API (Baileys-compatible)
|
|
502
709
|
|
|
@@ -512,9 +719,9 @@ const sock = makeWASocket({ version, auth: state, browser: Browsers.macOS('Chrom
|
|
|
512
719
|
sock.ev.on('creds.update', saveCreds);
|
|
513
720
|
```
|
|
514
721
|
|
|
515
|
-
|
|
722
|
+
Many Baileys-style APIs are exported. Check the available APIs before migrating; this fork is not a complete upstream mirror. Extra socket options: `companionPlatformDisplay`, `companionPlatformId`, `webSubPlatform`.
|
|
516
723
|
|
|
517
|
-
|
|
724
|
+
Selected fork additions and upstream ports (see [CHANGELOG.md](CHANGELOG.md) for sources; not all upstream changes are present): `WIN32 → WIN_HYBRID` for Windows Desktop, `requestPairingCode` via `query()` with `creds.me` set only after the ACK, tctoken handling, self-only `protocolMessage` guards, `groupOnlineCount`, no `<presence/>` on partial `creds.update`, `directPath`-first media downloads, Lottie sticker unwrapping, `ev.destroy()` / `signalRepository.close()` on socket end, `whatsapp-rust-bridge` 0.5.5.
|
|
518
725
|
|
|
519
726
|
## TypeScript
|
|
520
727
|
|
|
@@ -529,8 +736,8 @@ client.on('identity-changed', (i) => console.log(i.linkedDeviceName));
|
|
|
529
736
|
|
|
530
737
|
## Migrating from Baileys
|
|
531
738
|
|
|
532
|
-
1. `npm uninstall baileys && npm install @xbibzlibrary/whatsbibz`
|
|
533
|
-
2. Replace the import specifier
|
|
739
|
+
1. `npm uninstall baileys && npm install @xbibzlibrary/whatsbibz@2.1.0` (or install a local checkout).
|
|
740
|
+
2. Replace the import specifier and test the APIs and behavior your application uses.
|
|
534
741
|
3. Remove any `postinstall` patch scripts for `companion_reg_refresh` — the handler is built in.
|
|
535
742
|
4. Optional: replace your own connect/reconnect/pairing loop with `createBibzWhats()`.
|
|
536
743
|
|
|
@@ -538,19 +745,19 @@ client.on('identity-changed', (i) => console.log(i.linkedDeviceName));
|
|
|
538
745
|
|
|
539
746
|
| Symptom | Cause | Fix |
|
|
540
747
|
|---|---|---|
|
|
541
|
-
| Pairing code printed, phone shows
|
|
748
|
+
| Pairing code printed, phone shows no notification | The server ACK confirms the pairing request, not notification delivery or a linked device. A missing notification alone does not prove an incorrect number or a rate-limited IP. | On the phone, open **Linked devices → Link a device → Link with phone number instead** and enter the latest code. Check the number and connectivity; avoid repeated requests, particularly after `429`. |
|
|
542
749
|
| `428` immediately, no QR | The advertised identity is refused (e.g. `DARWIN` sub-platform). | Leave `identity` unset (auto rotates), or pick a profile from the table above. |
|
|
543
750
|
| `400 bad-request` at pairing | `companion_platform_display` not on the allow-list. | Don't override `companionPlatformDisplay`; the derived value is always valid. |
|
|
544
|
-
| `401` right after a reconnect while pairing |
|
|
751
|
+
| `401` right after a reconnect while pairing | Cause unknown; `pairingPending` is only a heuristic. | Default recovery may replace the session; `preserveSession: true` stops destructive recovery. |
|
|
545
752
|
| `408` loop | WhatsApp Web version too old. | Keep `fetchLatestVersion: true` (default) or update the package. |
|
|
546
|
-
| `give-up` after
|
|
753
|
+
| `give-up` after several session wipes | The server still rejects the connection; the cause is unknown. | Check account, session, number and network; avoid repeated pairing attempts. |
|
|
547
754
|
| Handlers stop working after a reconnect | Handlers were attached to the old socket. | Attach them inside `client.on('ready', sock => …)`. |
|
|
548
|
-
| Process won't exit |
|
|
755
|
+
| Process won't exit | A socket, worker, or application timer may still be active. | Await `client.close()` and release your own intervals and resources before exiting. |
|
|
549
756
|
|
|
550
757
|
## Testing
|
|
551
758
|
|
|
552
759
|
```bash
|
|
553
|
-
npm test #
|
|
760
|
+
npm test # offline tests incl. local sockets; live tests skipped by default
|
|
554
761
|
npm run check # export surface sanity check
|
|
555
762
|
npm run test:live # 11 tests against real WhatsApp servers (no phone needed; uses fictional Ofcom numbers)
|
|
556
763
|
```
|
|
@@ -573,10 +780,10 @@ test/ node:test suites (offline + live)
|
|
|
573
780
|
|
|
574
781
|
## Versioning and compatibility
|
|
575
782
|
|
|
576
|
-
-
|
|
577
|
-
-
|
|
578
|
-
-
|
|
579
|
-
- Changes
|
|
783
|
+
- Version 2.0.0 changed account behavior by attempting auto-follow by default; 2.1.0 restricts its automatic target to one channel and rejects other automatic JIDs. Sound stickers and VoIP are experimental.
|
|
784
|
+
- The high-level wrapper fetches the WhatsApp Web revision on connect unless disabled or explicitly pinned; the low-level socket uses its configured/fallback version without automatically fetching.
|
|
785
|
+
- Node 20 is EOL. See [SECURITY.md](SECURITY.md) for the patched supported Node lines.
|
|
786
|
+
- Changes and limitations: [CHANGELOG.md](CHANGELOG.md), [compatibility report](KOMPATIBILITAS-WHATSAPP-2026-11.md).
|
|
580
787
|
|
|
581
788
|
## Contributing
|
|
582
789
|
|
|
@@ -602,3 +809,9 @@ WhatsBibz is not affiliated with, endorsed by, or supported by WhatsApp or Meta.
|
|
|
602
809
|
</p>
|
|
603
810
|
|
|
604
811
|
[Ko-Fi](https://ko-fi.com/xbibzofficial) · [Saweria](https://saweria.co/XbibzOfficial) · [TikTok](https://tiktok.com/@xbibzofficial) · [Telegram](https://t.me/xbibzofc)
|
|
812
|
+
|
|
813
|
+
## Testing Update
|
|
814
|
+
|
|
815
|
+
- [x] Updated for WhatsApp compatibility
|
|
816
|
+
- [x] Fixed minor bugs
|
|
817
|
+
- Testing by: xbibz-agent
|
package/SECURITY.md
CHANGED
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
| Version | Supported |
|
|
8
8
|
|---|---|
|
|
9
|
-
| 1.
|
|
10
|
-
| < 1.
|
|
9
|
+
| 2.1.x (latest release) | Yes |
|
|
10
|
+
| < 2.1.0 | No — upgrade to the latest release |
|
|
11
11
|
|
|
12
|
-
Only the latest release receives security fixes.
|
|
12
|
+
Only the latest release receives security fixes. The [November 11, 2026 Node.js security release](https://nodejs.org/en/blog/vulnerability/november-2026-security-releases) fixes vulnerabilities on the supported lines. For production, use at least **22.23.5 on 22.x, 24.22.3 on 24.x, or 26.13.1 on 26.x**, and keep following later security releases. Node 20 is end-of-life. The October JavaScript helpers (`safeFetch`, `assertSafeUrl`, `withSafeFetchHeaders`) provide only partial defense in the code paths that call them; they do not replace patched Node.js, prevent all Brotli-related failures, or fix the November vulnerabilities.
|
|
13
|
+
|
|
14
|
+
**Untrusted media and preview URLs can cause SSRF.** When a `directPath` is present this checkout uses a constrained WhatsApp/Meta host selection unless the application explicitly overrides it. The legacy URL-only path remains compatible with arbitrary URLs; redirects and DNS/egress are not constrained by this selection. `safeFetch` checks the final response URL only *after* automatic redirects have been contacted. The optional `link-preview-js` peer now requires 4.0.4 or later within 4.x due to known advisories; `getUrlInfo` uses manual same-host redirects but does not itself pin or filter DNS by default, and preview images use another fetch path. Validate media metadata and URLs before access and enforce outbound network restrictions (including DNS/private-address controls), deadlines and size limits at the application/network layer. Do not treat any helper as a complete SSRF boundary.
|
|
15
|
+
|
|
16
|
+
**Media integrity:** the inherited `downloadEncryptedContent` decrypts and streams data but does not verify the trailing media MAC or message hashes. Streaming plaintext may be delivered before application validation. Do not treat downloaded media as authenticated on that basis; verify an independently trusted digest before processing or use a separately authenticated media implementation.
|
|
17
|
+
|
|
18
|
+
**Signal session logging:** `libsignal@6.0.0` can pass full session objects, including private ratchet and root keys, to `console.info`/`console.warn`. Version 2.0.0 installs a Node `util.inspect.custom` redaction on the `SessionEntry` prototype before use, without changing the process-wide console. It covers those ordinary Node console/inspection paths only; `console.dir`, JSON serialization, explicit `customInspect: false`, raw buffers, other logger paths, and other dependency instances can bypass it. Restrict or delete older logs and rotate affected linked sessions if key material may have been exposed. This change cannot remove secrets already recorded.
|
|
13
19
|
|
|
14
20
|
## Reporting a vulnerability
|
|
15
21
|
|
|
@@ -52,10 +58,16 @@ Out of scope: WhatsApp server behaviour, account bans, rate limits, and issues i
|
|
|
52
58
|
|
|
53
59
|
| Versi | Didukung |
|
|
54
60
|
|---|---|
|
|
55
|
-
| 1.
|
|
56
|
-
| < 1.
|
|
61
|
+
| 2.1.x (rilis terbaru) | Ya |
|
|
62
|
+
| < 2.1.0 | Tidak — perbarui ke rilis terbaru |
|
|
63
|
+
|
|
64
|
+
Hanya rilis terbaru yang menerima perbaikan keamanan. [Rilis keamanan Node.js 11 November 2026](https://nodejs.org/en/blog/vulnerability/november-2026-security-releases) memperbaiki kerentanan pada lini yang didukung. Untuk produksi, gunakan minimal **22.23.5 pada 22.x, 24.22.3 pada 24.x, atau 26.13.1 pada 26.x**, lalu ikuti rilis keamanan berikutnya. Node 20 sudah EOL. Helper JavaScript Oktober (`safeFetch`, `assertSafeUrl`, `withSafeFetchHeaders`) hanya memberi pertahanan parsial pada jalur yang memakainya; bukan pengganti Node yang dipatch, bukan jaminan mencegah semua masalah Brotli, dan tidak memperbaiki kerentanan November.
|
|
65
|
+
|
|
66
|
+
**URL media dan preview tak tepercaya dapat menimbulkan SSRF.** Dengan `directPath`, checkout ini membatasi pemilihan host WhatsApp/Meta kecuali aplikasi secara eksplisit override. Jalur legacy yang hanya memiliki URL masih menerima URL arbitrary; redirect dan DNS/egress tidak dibatasi oleh pemilihan host tersebut. `safeFetch` memeriksa URL respons akhir hanya *setelah* redirect otomatis diakses. Peer opsional `link-preview-js` kini memerlukan 4.0.4 atau lebih baru dalam 4.x karena advisory; `getUrlInfo` memakai redirect manual ke host yang sama, tetapi tidak melakukan pin/filter DNS secara default dan gambar preview memakai jalur unduhan lain. Validasi metadata dan URL sebelum akses, dan terapkan pembatasan jaringan keluar (termasuk DNS/alamat privat), timeout, serta batas ukuran pada aplikasi/jaringan. Jangan menganggap helper sebagai perlindungan SSRF menyeluruh.
|
|
67
|
+
|
|
68
|
+
**Integritas media:** `downloadEncryptedContent` bawaan mendekripsi dan melakukan streaming, tetapi belum memverifikasi MAC media di akhir maupun hash pesan. Plaintext stream dapat diterima sebelum validasi oleh aplikasi. Jangan menganggap hasil unduhan terautentikasi hanya berdasarkan helper ini; verifikasi digest yang tepercaya sebelum memproses atau gunakan implementasi media terautentikasi terpisah.
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
**Log sesi Signal:** `libsignal@6.0.0` dapat memberikan objek sesi lengkap, termasuk kunci ratchet privat dan root, ke `console.info`/`console.warn`. Versi 2.0.0 memasang redaksi Node `util.inspect.custom` pada prototipe `SessionEntry` sebelum digunakan, tanpa mengganti console global proses. Redaksi hanya mencakup jalur console/inspeksi Node biasa; `console.dir`, serialisasi JSON, `customInspect: false`, buffer mentah, logger lain, atau instance dependensi lain dapat melewatinya. Batasi akses atau hapus log lama dan rotasi perangkat tertaut yang terdampak jika materi kunci mungkin terekspos. Perubahan ini tidak menghapus rahasia yang sudah tercatat.
|
|
59
71
|
|
|
60
72
|
## Melaporkan kerentanan
|
|
61
73
|
|
package/WAProto/WAProto.proto
CHANGED
|
@@ -2349,6 +2349,7 @@ message Message {
|
|
|
2349
2349
|
optional PollAddOptionMessage pollAddOptionMessage = 121;
|
|
2350
2350
|
optional EventInviteMessage eventInviteMessage = 122;
|
|
2351
2351
|
optional GroupRootKeyShare groupRootKeyShare = 123;
|
|
2352
|
+
optional FutureProofMessage audioStickerMessage = 134;
|
|
2352
2353
|
message AlbumMessage {
|
|
2353
2354
|
optional uint32 expectedImageCount = 2;
|
|
2354
2355
|
optional uint32 expectedVideoCount = 3;
|
|
@@ -3809,6 +3810,9 @@ message Message {
|
|
|
3809
3810
|
optional string accessibilityLabel = 22;
|
|
3810
3811
|
optional int32 premium = 24;
|
|
3811
3812
|
optional string emojis = 25;
|
|
3813
|
+
oneof audio {
|
|
3814
|
+
Message.AudioMessage audioMessage = 26;
|
|
3815
|
+
}
|
|
3812
3816
|
}
|
|
3813
3817
|
|
|
3814
3818
|
message StickerPackMessage {
|
package/WAProto/index.d.ts
CHANGED
|
@@ -5726,6 +5726,7 @@ export namespace proto {
|
|
|
5726
5726
|
pollAddOptionMessage?: (proto.Message.IPollAddOptionMessage|null);
|
|
5727
5727
|
eventInviteMessage?: (proto.Message.IEventInviteMessage|null);
|
|
5728
5728
|
groupRootKeyShare?: (proto.IGroupRootKeyShare|null);
|
|
5729
|
+
audioStickerMessage?: (proto.Message.IFutureProofMessage|null);
|
|
5729
5730
|
}
|
|
5730
5731
|
|
|
5731
5732
|
class Message implements IMessage {
|
|
@@ -5833,6 +5834,7 @@ export namespace proto {
|
|
|
5833
5834
|
public pollAddOptionMessage?: (proto.Message.IPollAddOptionMessage|null);
|
|
5834
5835
|
public eventInviteMessage?: (proto.Message.IEventInviteMessage|null);
|
|
5835
5836
|
public groupRootKeyShare?: (proto.IGroupRootKeyShare|null);
|
|
5837
|
+
public audioStickerMessage?: (proto.Message.IFutureProofMessage|null);
|
|
5836
5838
|
public static create(properties?: proto.IMessage): proto.Message;
|
|
5837
5839
|
public static encode(m: proto.IMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
|
5838
5840
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message;
|
|
@@ -9773,6 +9775,7 @@ export namespace proto {
|
|
|
9773
9775
|
accessibilityLabel?: (string|null);
|
|
9774
9776
|
premium?: (number|null);
|
|
9775
9777
|
emojis?: (string|null);
|
|
9778
|
+
audioMessage?: (proto.Message.IAudioMessage|null);
|
|
9776
9779
|
}
|
|
9777
9780
|
|
|
9778
9781
|
class StickerMessage implements IStickerMessage {
|
|
@@ -9799,6 +9802,8 @@ export namespace proto {
|
|
|
9799
9802
|
public accessibilityLabel?: (string|null);
|
|
9800
9803
|
public premium?: (number|null);
|
|
9801
9804
|
public emojis?: (string|null);
|
|
9805
|
+
public audioMessage?: (proto.Message.IAudioMessage|null);
|
|
9806
|
+
public audio?: "audioMessage";
|
|
9802
9807
|
public static create(properties?: proto.Message.IStickerMessage): proto.Message.StickerMessage;
|
|
9803
9808
|
public static encode(m: proto.Message.IStickerMessage, w?: $protobuf.Writer): $protobuf.Writer;
|
|
9804
9809
|
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Message.StickerMessage;
|