Skip to content

fix(whatsapp): bump baileys to 7.0.0-rc.13 to patch CVE-2026-48063 - #54395

Closed
dovginsburg wants to merge 1 commit into
NousResearch:mainfrom
dovginsburg:fix/whatsapp-baileys-cve-2026-48063
Closed

fix(whatsapp): bump baileys to 7.0.0-rc.13 to patch CVE-2026-48063#54395
dovginsburg wants to merge 1 commit into
NousResearch:mainfrom
dovginsburg:fix/whatsapp-baileys-cve-2026-48063

Conversation

@dovginsburg

Copy link
Copy Markdown

Summary

Fix CVE-2026-48063 (critical) in the WhatsApp bridge by bumping @whiskeysockets/baileys from a pre-CVE git SHA to the patched npm version ^7.0.0-rc.13. This clears all 5 outstanding npm audit findings (1 critical, 2 high, 2 moderate) that currently show up in hermes doctor.

Root cause

scripts/whatsapp-bridge/package.json pins baileys to WhiskeySockets/Baileys#01047debd81beb20da7b7779b08edcb06aa03770, which resolves to 7.0.0-rc.9. CVE-2026-48063 / GHSA-qvv5-jq5g-4cgg was patched in 7.0.0-rc.12 (and rc.13 adds a regression fix), but because the dep is referenced via git SHA, npm audit reports "no fix available" — even though the patched versions exist on the registry.

Why we can't use the override pattern from #19204

PR #19204 (Teknium, May 2026) deliberately avoided bumping baileys because at the time all npm-published 7.0.0-rc.* versions pulled the same vulnerable libsignal-node tree. Since then Baileys shipped 7.0.0-rc.10, rc.11 (rc.11 release notes: "pinned the libsignal pipeline to the NPM registry"), rc.12 (CVE fix), and rc.13 (regression fix). The CVE-patched libsignal pipeline is now on the registry.

Changes

Validation

  • npm audit: 5 vulns (1 critical, 2 high, 2 moderate) → 0 vulnerabilities
  • Installed versions after fix: baileys 7.0.0-rc13, protobufjs 7.6.4, qs 6.15.3, ws 8.21.0, express 4.22.2
  • node --check bridge.js: parses cleanly
  • node -e "import('@whiskeysockets/baileys')": 263 exports resolve, including all 5 the bridge imports (makeWASocket, useMultiFileAuthState, DisconnectReason, fetchLatestBaileysVersion, downloadMediaMessage)
  • Live bridge after launchctl bootoutnpm installlaunchctl bootstrap: {"status":"connected","queueLength":0,"uptime":N}

Out of scope

The following are working-tree-only changes on Dov's local checkout, intentionally NOT included in this PR:

  • markOnlineOnConnect: true + presence keepalive (60s) + sendReceipts for blue checks — Dov's 2026-05-31 local patches for presence/read-receipt behavior
  • ensure-local-patches.py invariant checker that enforces the above patches stay applied
  • .bak files and scratch files in the bridge dir

If maintainers want those upstream too, happy to send a separate PR — they are behaviorally orthogonal to the CVE fix.

Refs

The whatsapp-bridge pins @whiskeysockets/baileys to a pre-CVE git SHA
(01047debd81beb20da7b7779b08edcb06aa03770, version 7.0.0-rc.9). npm audit
therefore reports "no fix available" for GHSA-qvv5-jq5g-4cgg even though
the npm registry carries the patched 7.0.0-rc.12+ releases.

CVE-2026-48063 (critical): a maliciously crafted protocolMessage payload
can trigger message upsert / hist sync spoofing and app state corruption
in any session running < 7.0.0-rc.12 (or legacy < 6.7.22). The attacker
only needs to send a message to the connected WhatsApp account.

Why we couldn't use the override pattern from #19204: that PR intentionally
avoided bumping baileys because at the time all npm-published 7.0.0-rc.*
versions pulled the same vulnerable libsignal-node tree. Since then
Baileys has shipped rc.10, rc.11, rc.12 (CVE fix), and rc.13 (regression
fix on top of rc.12). The CVE-patched libsignal pipeline is now on the
npm registry — see Baileys rc.11 release notes ("pinned the libsignal
pipeline to the NPM registry").

Fix:
- Switch @whiskeysockets/baileys dep from a git SHA to ^7.0.0-rc.13 so
  dependabot and the override-based dedupe can follow it.
- Bump express ^4.21.0 -> ^4.21.2 to pull in the latest transitive qs
  fix that dependabot bumped in #28975 era but main never picked up.
- Keep the existing protobufjs ^7.5.5 override from #19204.

Validation:
- npm audit: 5 vulns (1 critical, 2 high, 2 moderate) -> 0 vulnerabilities
- Versions after fix: baileys 7.0.0-rc13, protobufjs 7.6.4, qs 6.15.3,
  ws 8.21.0, express 4.22.2
- node --check bridge.js: parses cleanly
- node -e "import('@whiskeysockets/baileys')": all 263 exports resolve,
  including the 5 the bridge imports (makeWASocket, useMultiFileAuthState,
  DisconnectReason, fetchLatestBaileysVersion, downloadMediaMessage)
- Live bridge after restart: {"status":"connected","queueLength":0}

Out of scope (working-tree-only, not in this PR):
- markOnlineOnConnect / presence keepalive / sendReceipts patches in
  bridge.js (Dov's 2026-05-31 local changes for blue-check behavior)
- ensure-local-patches.py invariant checker (enforces the above)
- All .bak files and the _group_observer.py scratch file

Refs: GHSA-qvv5-jq5g-4cgg, CVE-2026-48063, PR #19204
@dovginsburg
dovginsburg requested a review from a team June 28, 2026 19:17
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter dependencies Pull requests that update a dependency file P2 Medium — degraded but workaround exists labels Jun 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing/overlapping with the open CVE cluster for GHSA-qvv5-jq5g-4cgg: #47805 (rc.9->rc.13 security bump), #44980 (npm audit fix, 5/5 vulns), and CVE issue #43814. This PR does the same rc.13 bump plus the express/npm-audit cleanup. Flagging for a maintainer to pick the canonical one — not marking duplicate since the scope differs.

@egilewski

Copy link
Copy Markdown
Contributor

superseded

Review setup note: I reviewed a run-owned patch replay of this PR's two-file dependency diff against current GitHub main (b9b463f3bd6517b76687d9b3c9dea1e62f01f9e1) because the submitted branch has an unrelated-history/current-main conflict; this does not mean the submitted branch itself merges cleanly.

Current main already resolves Baileys 7.0.0-rc13, express 4.22.2, qs 6.15.3, ws 8.21.0, and protobufjs 7.6.5, and npm audit --package-lock-only --audit-level=moderate --json reports zero vulnerabilities there. The replayed PR diff also audits clean, but it no longer supplies the claimed CVE fix; it changes the root Baileys range to ^7.0.0-rc.13 and express to ^4.21.2 while moving protobufjs from 7.6.5 to 7.6.4 and sharp optional packages from 0.35.3 to 0.35.2.

I also checked npm install --package-lock-only --ignore-scripts --dry-run, node --check bridge.js, and git diff --check on the replay, plus the same lockfile dry-run and syntax check on current main.

Signed: GPT-5.5-xhigh in Codex

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused security update. This is an automated hermes-sweeper review; the requested Baileys migration is already implemented on current main.

  • scripts/whatsapp-bridge/package.json:11 now pins the published 7.0.0-rc13 package.
  • scripts/whatsapp-bridge/package-lock.json:756-766 resolves that release from npm and records the registry-backed libsignal dependency.
  • Commit c30c9753b6efc08e154d66b6501a444739df3859 (fix(whatsapp): unpin Baileys from git commit, use published 7.0.0-rc13 (#60643)) supplies this behavioral fix and is included in v2026.7.7.2.
  • This also confirms the contributor follow-up identifying the PR as superseded.

@teknium1 teknium1 closed this Jul 15, 2026
@teknium1 teknium1 added sweeper:implemented-on-main Sweeper: behavior already present on current main sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery dependencies Pull requests that update a dependency file P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:implemented-on-main Sweeper: behavior already present on current main sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants