@xbibzlibrary/whatsbibz 1.3.0 → 1.3.2

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/SECURITY.md ADDED
@@ -0,0 +1,91 @@
1
+ # Security Policy
2
+
3
+ *Bahasa Indonesia di bawah / Indonesian version below.*
4
+
5
+ ## Supported versions
6
+
7
+ | Version | Supported |
8
+ |---|---|
9
+ | 1.3.x | Yes |
10
+ | < 1.3 | No — please upgrade |
11
+
12
+ Only the latest minor release receives security fixes.
13
+
14
+ ## Reporting a vulnerability
15
+
16
+ **Please do not open a public issue for security problems.**
17
+
18
+ Report privately by one of these channels:
19
+
20
+ - GitHub: **Security → Report a vulnerability** on this repository (private advisory).
21
+ - Email: **revandoppratama@gmail.com** with the subject `[whatsbibz security]`.
22
+
23
+ Include:
24
+
25
+ - A description of the issue and its impact.
26
+ - Steps or a script to reproduce it.
27
+ - The package version (`npm ls @xbibzlibrary/whatsbibz`) and Node.js version.
28
+ - Whether the issue requires a paired session, network position, or a malicious remote peer.
29
+
30
+ You will get an acknowledgement within **3 business days** and a status update at least every **7 days** until the issue is resolved. When a fix is released you will be credited in the changelog unless you prefer otherwise.
31
+
32
+ ## What counts as a vulnerability here
33
+
34
+ - Anything that lets a **remote WhatsApp peer** (a contact, a group member, a newsletter) execute code, crash the process, corrupt local state or read data it should not — for example through a crafted `protocolMessage`, media metadata or app-state patch.
35
+ - Leakage of session material (`creds.json`, signal keys, `identity.json`) through logs, error messages or file permissions.
36
+ - Weaknesses in the pairing or Noise handshake handling that were introduced by this fork.
37
+ - Dependency vulnerabilities that are reachable from this package's code paths.
38
+
39
+ Out of scope: WhatsApp server behaviour, account bans, rate limits, and issues in the upstream Baileys project that are not reachable through WhatsBibz (please report those upstream).
40
+
41
+ ## Handling secrets safely
42
+
43
+ - Session folders contain long-lived credentials. Keep them outside the repository, with restrictive permissions, and never share them.
44
+ - Rotate your credentials (`client.logout()` and re-pair) if a session folder may have leaked.
45
+ - Do not paste `creds.json`, pairing codes for real numbers, or tokens into issues.
46
+
47
+ ---
48
+
49
+ # Kebijakan Keamanan
50
+
51
+ ## Versi yang didukung
52
+
53
+ | Versi | Didukung |
54
+ |---|---|
55
+ | 1.3.x | Ya |
56
+ | < 1.3 | Tidak — silakan perbarui |
57
+
58
+ Hanya rilis minor terbaru yang menerima perbaikan keamanan.
59
+
60
+ ## Melaporkan kerentanan
61
+
62
+ **Jangan membuka issue publik untuk masalah keamanan.**
63
+
64
+ Laporkan secara pribadi lewat salah satu jalur berikut:
65
+
66
+ - GitHub: **Security → Report a vulnerability** di repositori ini (advisory privat).
67
+ - Email: **revandoppratama@gmail.com** dengan subjek `[whatsbibz security]`.
68
+
69
+ Sertakan:
70
+
71
+ - Deskripsi masalah dan dampaknya.
72
+ - Langkah atau skrip untuk mereproduksinya.
73
+ - Versi paket (`npm ls @xbibzlibrary/whatsbibz`) dan versi Node.js.
74
+ - Apakah masalah memerlukan sesi yang sudah tertaut, posisi jaringan tertentu, atau lawan bicara jarak jauh yang berniat jahat.
75
+
76
+ Kamu akan menerima konfirmasi dalam **3 hari kerja** dan pembaruan status setidaknya setiap **7 hari** sampai masalah selesai. Saat perbaikan dirilis, namamu dicantumkan di changelog kecuali kamu meminta sebaliknya.
77
+
78
+ ## Yang dianggap kerentanan di sini
79
+
80
+ - Apa pun yang memungkinkan **peer WhatsApp jarak jauh** (kontak, anggota grup, newsletter) mengeksekusi kode, membuat proses crash, merusak state lokal, atau membaca data yang seharusnya tidak bisa — misalnya lewat `protocolMessage`, metadata media, atau patch app-state yang direkayasa.
81
+ - Kebocoran materi sesi (`creds.json`, kunci signal, `identity.json`) lewat log, pesan error, atau izin berkas.
82
+ - Kelemahan dalam penanganan pairing atau handshake Noise yang diperkenalkan oleh fork ini.
83
+ - Kerentanan dependensi yang dapat dijangkau dari jalur kode paket ini.
84
+
85
+ Di luar cakupan: perilaku server WhatsApp, pemblokiran akun, batas laju, dan masalah di proyek upstream Baileys yang tidak dapat dijangkau lewat WhatsBibz (silakan laporkan ke upstream).
86
+
87
+ ## Menjaga rahasia dengan aman
88
+
89
+ - Folder sesi berisi kredensial berumur panjang. Simpan di luar repositori, dengan izin terbatas, dan jangan pernah dibagikan.
90
+ - Rotasi kredensialmu (`client.logout()` lalu pairing ulang) bila folder sesi mungkin bocor.
91
+ - Jangan menempelkan `creds.json`, pairing code untuk nomor sungguhan, atau token ke dalam issue.
@@ -302,7 +302,15 @@ export async function createBibzWhats(options = {}) {
302
302
  stopPairingRef = stopPairing;
303
303
 
304
304
  sock.ev.on('creds.update', (update) => {
305
- void saveCreds(update);
305
+ // Folder sesi bisa sudah hilang (dihapus pemakai / wipe / close di tengah tulis):
306
+ // jangan biarkan jadi unhandled rejection yang mematikan proses.
307
+ saveCreds(update).catch((e) => {
308
+ if (closedByUser || e?.code === 'ENOENT') {
309
+ if (!closedByUser) log.warn(`BibzWhats: gagal menyimpan kredensial (${e.code}) — folder sesi ${opts.authDir} hilang; akan dibuat ulang saat sambung berikutnya.`);
310
+ return;
311
+ }
312
+ log.error(`BibzWhats: gagal menyimpan kredensial: ${e?.message || e}`);
313
+ });
306
314
  if (sock.authState.creds.registered) stopPairing();
307
315
  });
308
316
 
@@ -316,12 +324,12 @@ export async function createBibzWhats(options = {}) {
316
324
  if (opts.phone && !pairingStarted) {
317
325
  pairingStarted = true;
318
326
  log.info('BibzWhats: perangkat belum terdaftar — meminta pairing code...');
319
- void pairing.start();
327
+ pairing.start().catch((e) => log.error(`BibzWhats: pairing gagal: ${e?.message || e}`));
320
328
  }
321
329
  const showQr = !opts.phone || Date.now() - pairingStartedAt > opts.qrFallbackAfterMs;
322
330
  if (showQr) {
323
331
  emitter.emit('qr', qr);
324
- if (opts.printQR) void printQrToTerminal(qr, log);
332
+ if (opts.printQR) Promise.resolve(printQrToTerminal(qr, log)).catch(() => {});
325
333
  }
326
334
  }
327
335
  if (sock.authState.creds.registered) stopPairing();
@@ -331,7 +339,7 @@ export async function createBibzWhats(options = {}) {
331
339
  if (!sock.authState.creds.registered && !pairingStarted) {
332
340
  pairingStarted = true;
333
341
  log.info('BibzWhats: QR tidak diterima — minta pairing code langsung...');
334
- void pairing.start();
342
+ pairing.start().catch((e) => log.error(`BibzWhats: pairing gagal: ${e?.message || e}`));
335
343
  }
336
344
  }, opts.pairingRequestDelayMs);
337
345
  }
@@ -1,7 +1,7 @@
1
1
  export const BIBZWHATS_NAME = 'WhatsBibz';
2
2
  /** nama paket di npm */
3
3
  export const BIBZWHATS_PACKAGE = '@xbibzlibrary/whatsbibz';
4
- export const BIBZWHATS_VERSION = '1.3.0';
4
+ export const BIBZWHATS_VERSION = '1.3.2';
5
5
  export const BIBZWHATS_UPSTREAM = 'ourin-baileys@9.0.21 (fork WhiskeySockets/Baileys v7) + patch upstream s/d rc14/master 2026-08 & PR #2769/#2776/#2778/#2789; identitas platform diukur ke server 2026-09-03';
6
6
  /** versi WA Web bawaan (fallback) — diperbarui 2026-09-03 dari web.whatsapp.com */
7
- export const BIBZWHATS_WA_WEB_VERSION = [2, 3000, 1046721733];
7
+ export const BIBZWHATS_WA_WEB_VERSION = [2, 3000, 1046874154];
@@ -2,7 +2,7 @@ import { proto } from "../../WAProto/index.js";
2
2
  import { makeLibSignalRepository } from "../Signal/libsignal.js";
3
3
  import { Browsers } from "../Utils/browser-utils.js";
4
4
  import logger from "../Utils/logger.js";
5
- const version = [2, 3000, 1046721733];
5
+ const version = [2, 3000, 1046874154];
6
6
  export const UNAUTHORIZED_CODES = [401, 403, 419];
7
7
  export const DEFAULT_ORIGIN = "https://web.whatsapp.com";
8
8
  export const CALL_VIDEO_PREFIX = "https://call.whatsapp.com/video/";
@@ -28,9 +28,9 @@ export const Browsers = {
28
28
  linux: browser => ['Linux', browser, '6.12.44'],
29
29
  baileys: browser => ['Baileys', browser, '6.5.0'],
30
30
  /** identitas companion BibzWhats (tampil di daftar perangkat tertaut) */
31
- whatsbibz: browser => ['WhatsBibz', browser, '1.3.0'],
31
+ whatsbibz: browser => ['WhatsBibz', browser, '1.3.2'],
32
32
  /** alias lama */
33
- bibzwhats: browser => ['WhatsBibz', browser, '1.3.0'],
33
+ bibzwhats: browser => ['WhatsBibz', browser, '1.3.2'],
34
34
  windows: browser => ['Windows', browser, '10.0.22631'],
35
35
  /** eksperimental (upstream #2201): companion Android — bisa menerima view-once */
36
36
  android: browser => [browser, 'Android', ''],
@@ -1,7 +1,7 @@
1
1
  import { Boom } from '@hapi/boom';
2
2
  import { createHash, randomBytes } from 'crypto';
3
3
  import { proto } from '../../WAProto/index.js';
4
- const bibzWhatsVersion = [2, 3000, 1046721733];
4
+ const bibzWhatsVersion = [2, 3000, 1046874154];
5
5
  import { DisconnectReason } from '../Types/index.js';
6
6
  import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
7
7
  import { sha256 } from './crypto.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xbibzlibrary/whatsbibz",
3
- "version": "1.3.0",
4
- "description": "WhatsBibz — library WhatsApp Web multi-device (fork Baileys v7 / ourin-baileys) untuk ekosistem Xbibz: pairing code custom, identitas perangkat kustom/otomatis, auto-reconnect, self-healing session, handler companion_reg_refresh bawaan, interactive message, album, newsletter, VoIP.",
3
+ "version": "1.3.2",
4
+ "description": "WhatsBibz — WhatsApp Web multi-device library for Node.js (maintained Baileys fork): high-level client, custom pairing codes, self-healing sessions, configurable or automatic linked-device identity, complete TypeScript declarations.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -20,6 +20,7 @@
20
20
  "LICENSE",
21
21
  "LICENSE.upstream",
22
22
  "README.md",
23
+ "README.id.md",
23
24
  "CHANGELOG.md",
24
25
  "assets/logo/preview.png",
25
26
  "assets/logo/whatsbibz.ico",
@@ -27,7 +28,8 @@
27
28
  "assets/logo/png/mark-512.png",
28
29
  "assets/logo/png/banner-1200x360.png",
29
30
  "assets/logo/README.md",
30
- "VERIFIKASI-IDENTITAS-2026-09-03.md"
31
+ "VERIFIKASI-IDENTITAS-2026-09-03.md",
32
+ "SECURITY.md"
31
33
  ],
32
34
  "scripts": {
33
35
  "test": "node --test test/*.test.js",
@@ -50,9 +52,21 @@
50
52
  "bot",
51
53
  "automation"
52
54
  ],
53
- "author": "Xbibz Developer",
55
+ "author": {
56
+ "name": "Xbibz Developer",
57
+ "email": "revandoppratama@gmail.com",
58
+ "url": "https://github.com/XbibzOfficial777"
59
+ },
54
60
  "license": "MIT",
55
- "homepage": "https://www.npmjs.com/package/@xbibzlibrary/whatsbibz",
61
+ "homepage": "https://github.com/XbibzOfficial777/whatsbibz#readme",
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/XbibzOfficial777/whatsbibz.git"
65
+ },
66
+ "bugs": {
67
+ "url": "https://github.com/XbibzOfficial777/whatsbibz/issues",
68
+ "email": "revandoppratama@gmail.com"
69
+ },
56
70
  "engines": {
57
71
  "node": ">=20.0.0"
58
72
  },
@@ -105,7 +119,7 @@
105
119
  }
106
120
  },
107
121
  "devDependencies": {
108
- "typescript": "^5.9.2",
122
+ "typescript": "^7.0.2",
109
123
  "@types/node": "^22.18.0"
110
124
  }
111
125
  }