Skip to content

chore(whatsapp-bridge): npm audit fix + bump Baileys to patched release (5 of 5 vulns) - #44980

Closed
capitelist wants to merge 1 commit into
NousResearch:mainfrom
capitelist:chore/whatsapp-bridge-audit-fix
Closed

chore(whatsapp-bridge): npm audit fix + bump Baileys to patched release (5 of 5 vulns)#44980
capitelist wants to merge 1 commit into
NousResearch:mainfrom
capitelist:chore/whatsapp-bridge-audit-fix

Conversation

@capitelist

@capitelist capitelist commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Resolves all 5 npm audit vulnerabilities in scripts/whatsapp-bridge/ — the 4 moderate transitive deps and the 1 critical in @whiskeysockets/baileys. Closes #43814.

package before after advisory
protobufjs <=7.5.7 7.6.4 GHSA-jggg-4jg4-v7c6 (mod)
qs 6.11.1-6.15.1 6.15.2 GHSA-q8mj-m7cp-5q26 (mod)
ws 8.0.0 - 8.20.0 8.21.0 GHSA-58qx-3vcg-4xpx (mod)
express 4.21.0 - 4.22.1 4.22.2 transitive via qs
@whiskeysockets/baileys 01047deb (rc.9) 1aee6ed6 (rc.12) GHSA-qvv5-jq5g-4cgg (critical)

The Baileys bump moves the pin from the pre-fix commit 01047deb to the rc.12 release commit 1aee6ed6011ef77035c2b072eff478fc5f327809, which is 1 commit ahead of the upstream fix 3beb08e (verified via GitHub compare API: ahead_by: 1, behind_by: 0).

Why not also apply shouldSyncHistoryMessage: () => false?

The advisory recommends that flag as a workaround. Evaluated and rejected: Baileys 7.x logs a DANGER warning when history sync is disabled, stating it "PREVENTS BAILEYS FROM ACCESSING INITIAL LID MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS". scripts/whatsapp-bridge/allowlist.js relies on those LID mappings for sender identity expansion (lines 36-64), so the workaround would break allowlist matching on first connect. The pin bump to rc.12 makes the workaround unnecessary because the fix is included in that release.

Verified

  • npm install clean (one pre-existing pino peer-dep warning, unrelated)
  • npm audit reports 0 vulnerabilities
  • node --check bridge.js passes
  • Bridge startup smoke test: starts cleanly on :3000, session dir loaded, QR rendered, exits cleanly on SIGTERM, no DANGER warning (workaround not applied)

Test plan for reviewer

  1. cd scripts/whatsapp-bridge && npm install
  2. npm audit — expect "found 0 vulnerabilities"
  3. node --check bridge.js
  4. (Optional, requires WhatsApp account) npm start — expect QR render and successful auth

@capitelist
capitelist requested a review from a team June 12, 2026 14:37
@alt-glitch alt-glitch added type/security Security vulnerability or hardening P2 Medium — degraded but workaround exists platform/whatsapp WhatsApp Business adapter comp/gateway Gateway runner, session dispatch, delivery dependencies Pull requests that update a dependency file labels Jun 12, 2026

@egilewski egilewski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: request changes

I reviewed this against current GitHub main a118b94a856ef80301cb26d16be6d08c0104e0db, PR base d62979a6f34f64f2ed840f159aac66e24d7cad78, and PR head 4b9e113c8b76e6f6e512ffcddb5e2347fb37c407.

Validation:

  • gh pr checks 44980 --repo NousResearch/hermes-agent: no checks reported, so there is no completed PR-specific failing check to gate on.
  • git fetch --no-tags upstream main and git -c maintenance.auto=false -c gc.auto=0 fetch --no-tags upstream +pull/44980/head:refs/remotes/upstream/pr/44980: passed.
  • git rev-list --left-right --count refs/remotes/upstream/main...refs/remotes/upstream/pr/44980: 411 104, showing the submitted branch is far behind/diverged from current main.
  • git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr/44980: failed with content conflicts in many current-main files, including agent/agent_runtime_helpers.py, agent/tool_executor.py, apps/desktop/electron/main.cjs, gateway/run.py, hermes_cli/web_server.py, scripts/release.py, tests/test_tui_gateway_server.py, and tools/transcription_tools.py.
  • git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr/44980: failed on the submitted branch diff.

Finding:
The GitHub PR file list is focused on scripts/whatsapp-bridge/package-lock.json, but the submitted branch itself is stale and does not currently merge into GitHub main. Please rebase/update the branch so the dependency lockfile change can be validated against the current tree; I stopped review at the mergeability gate, so there may be other issues after the branch is made current.

Signed: GPT-5.5-xhigh in Codex

…se (5 of 5 vulns)

Resolves all 5 npm audit vulnerabilities in scripts/whatsapp-bridge/.
Closes the remaining critical (GHSA-qvv5-jq5g-4cgg) by bumping the
@whiskeysockets/baileys pin to the rc.12 release commit, which contains
the upstream fix (3beb08e).

Transitive vulnerabilities (lockfile only):

  - protobufjs:  bumped to 7.6.4  (was <=7.5.7)        [moderate, GHSA-jggg-4jg4-v7c6]
  - qs:         bumped to 6.15.2 (was 6.11.1-6.15.1)  [moderate, GHSA-q8mj-m7cp-5q26]
  - ws:         bumped to 8.21.0 (was 8.0.0-8.20.0)   [moderate, GHSA-58qx-3vcg-4xpx]
  - express:    bumped to 4.22.2 (was 4.21.0-4.22.1)  [transitive via qs]

Critical resolved by Baileys pin bump:

  - @whiskeysockets/baileys 7.0.0-rc12 (was pinned to commit 01047deb,
    resolving to 7.0.0-rc.9)  [critical, GHSA-qvv5-jq5g-4cgg]

The advisory-recommended workaround (shouldSyncHistoryMessage: () => false)
was evaluated and rejected: Baileys 7.x logs a DANGER warning when history
sync is disabled, stating it "PREVENTS BAILEYS FROM ACCESSING INITIAL LID
MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS". The bridge's
allowlist.js relies on those LID mappings for sender identity expansion
(lines 36-64), so disabling history sync would break allowlist matching
on first connect. The pin bump to rc.12 makes the workaround unnecessary
because the fix is included in that release.

Verified:
  - npm audit: 0 vulnerabilities
  - node --check bridge.js: passes
  - bridge startup smoke test: starts, listens on :3000, renders QR

Reference: tracking issue NousResearch#43814 (consolidated Baileys CVE tracker)
Reference: lockfile-only precursor was this PR's earlier revision
@capitelist capitelist changed the title chore(whatsapp-bridge): npm audit fix (4 of 5 vulns) chore(whatsapp-bridge): npm audit fix + bump Baileys to patched release (5 of 5 vulns) Jun 13, 2026
@capitelist capitelist changed the title chore(whatsapp-bridge): npm audit fix + bump Baileys to patched release (5 of 5 vulns) chore(whatsapp-bridge): npm audit fix (4 of 5 vulns) Jun 13, 2026
@capitelist
capitelist force-pushed the chore/whatsapp-bridge-audit-fix branch from 4b9e113 to e7b0193 Compare June 13, 2026 19:51
@capitelist capitelist changed the title chore(whatsapp-bridge): npm audit fix (4 of 5 vulns) chore(whatsapp-bridge): npm audit fix + bump Baileys to patched release (5 of 5 vulns) Jun 13, 2026

@egilewski egilewski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks mergeable

Validation:

  • Reviewed against current GitHub main 992b9223893453b3b1527b2ba728996ec81e83f2, PR base 425e777f54b810b7d762b0a5bbe8372dcf782def, and PR head e7b01934340151416d135a3a744a86c64d243c06.
  • GitHub's generated merge ref 7c74a288cf201e945d02579758fc225ace8b7ede is parented to current main and the PR head, and its diff against current main is limited to scripts/whatsapp-bridge/package.json and scripts/whatsapp-bridge/package-lock.json.
  • npm audit --package-lock-only --json in scripts/whatsapp-bridge went from 7 vulnerabilities on current main to 0 vulnerabilities on this PR's merge ref.
  • npm install --package-lock-only --ignore-scripts --dry-run in scripts/whatsapp-bridge exited 0 and left the lockfile clean.
  • node --test allowlist.test.mjs passed 5 tests.
  • CodeRabbit ran against the committed merge-ref diff with --base upstream/main and reported no findings.

Signed: GPT-5 in Codex

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the security-focused dependency update and for documenting why the history-sync workaround was unsuitable.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 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:implemented-on-main Sweeper: behavior already present on current main type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(whatsapp-bridge): bump Baileys to >=7.0.0-rc12 for CVE-2026-48063 (GHSA-qvv5-jq5g-4cgg)

4 participants