Skip to content

WhatsApp plugin sends unsolicited pairing messages to random contacts on reconnect #97088

Closed as not planned

Description

@saipreethigattu98

Plugin: @openclaw/whatsapp v2026.6.10

Description:
When the WhatsApp Web session reconnects (e.g., after Gateway restart), the plugin's phone-number-based pairing fallback sends WhatsApp messages to random phone numbers from the linked account's address book (~6,585 contacts in our case).

The message sent was:

OpenClaw: access not configured.
Your WhatsApp phone number: +91xxxxxxxxxx
Pairing code: XXXXXXX
Ask the bot owner to approve with: openclaw pairing approve whatsapp XXXXXXX

Impact: The user's WhatsApp contacts received unsolicited messages from their number asking them to pair with OpenClaw. This happened without any user or agent action — just Gateway restarts during normal config changes triggered the WhatsApp plugin's reconnect logic. Two contacts were messaged before we caught it.

Expected behavior:
The WhatsApp plugin should not send outbound messages to random contacts from the address book without explicit user confirmation. Number-based pairing should either:

  1. Only send to a pre-configured phone number set by the user in config
  2. Require explicit user confirmation before any message is dispatched
  3. Default to not sending any outbound pairing messages

Steps to reproduce:

  1. Enable WhatsApp plugin ("whatsapp": { "enabled": true })
  2. Link a WhatsApp account (scan QR code)
  3. Restart the Gateway multiple times
  4. Check if pairing codes are sent to contacts from the address book

Mitigation:

  • Disabled the plugin ("whatsapp": { "enabled": false })
  • Deleted WhatsApp credentials at ~/.openclaw/credentials/whatsapp/

Environment:

  • OpenClaw 2026.6.10
  • Ubuntu on WSL2 (Windows)
  • WhatsApp plugin installed from npm package

Activity

  1. clawsweeper commented on Jun 26, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 26, 2026, 3:13 PM ET / 19:13 UTC.

    Summary
    Keep open: current main reduces older no-content and historical-message cases, but it still has an intentional pairing-reply send path for content-bearing unknown WhatsApp DMs, and there is no live reconnect/address-book proof showing the fresh v2026.6.10 report is fixed.

    Reproducibility: no. not at high confidence from live behavior. Source inspection shows the remaining pairing-send path for content-bearing unknown DMs, but I did not reproduce the reconnect/address-book event against a real linked WhatsApp account.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    The fix shape is plausible, but the report is security-sensitive and needs maintainer/security review plus live WhatsApp reconnect evidence before automation changes pairing semantics.

    Security
    Needs attention: The issue itself is security-sensitive because unsolicited pairing replies can expose setup codes and contact private WhatsApp recipients without intent.

    Review details

    Best possible solution:

    Keep this open as the canonical fresh v2026.6.10 tracker for WhatsApp/security maintainers to capture the live reconnect event shape and tighten the plugin inbound boundary without breaking legitimate first-DM pairing.

    Do we have a high-confidence way to reproduce the issue?

    No, not at high confidence from live behavior. Source inspection shows the remaining pairing-send path for content-bearing unknown DMs, but I did not reproduce the reconnect/address-book event against a real linked WhatsApp account.

    Is this the best way to solve the issue?

    Unclear until the exact Baileys reconnect event is captured. The likely best fix is a WhatsApp-owned inbound gate for reconnect/history/contact-sync side effects, while preserving deliberate live first-DM pairing behavior.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live WhatsApp reconnect reproduction was run in this read-only review, so the exact Baileys event shape behind the address-book/contact selection remains unconfirmed.
    • A fix can break the documented/default first-DM pairing behavior unless maintainers preserve live inbound DM pairing while suppressing reconnect/history/sync side effects.

    Codex review notes: model internal, reasoning high; reviewed against e5123e44b0f5.

    Label changes

    Label changes:

    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: The issue describes an urgent privacy-impacting WhatsApp channel bug affecting a real user on the latest stable release.
    • impact:security: The reported behavior can disclose pairing-code instructions and contact private WhatsApp address-book entries without user intent.
    • impact:message-loss: The affected channel path can misdirect outbound WhatsApp messages to unintended recipients.
    Evidence reviewed

    Security concerns:

    • [high] Unsolicited pairing replies can expose access codes — extensions/whatsapp/src/inbound/access-control.ts:161
      The reported behavior sends pairing-code instructions to unintended WhatsApp contacts, creating a privacy and social-engineering risk even if final approval still requires the owner.
      Confidence: 0.78

    Acceptance criteria:

    • node scripts/run-vitest.mjs extensions/whatsapp/src/inbound/access-control.test.ts
    • node scripts/run-vitest.mjs extensions/whatsapp/src/inbound/extract.test.ts
    • node scripts/run-vitest.mjs extensions/whatsapp/src/monitor-inbox.behavior.test.ts
    • Real WhatsApp reconnect proof with redacted phone numbers showing no pairing replies are sent to contacts without a live inbound DM

    What I checked:

    • AGENTS.md policy read: Root policy was read fully and requires high-confidence source, tests/current behavior, dependency contract proof, and security-sensitive handling for this plugin review. (AGENTS.md:1, e5123e44b0f5)
    • Scoped extension policy read: The scoped extension policy treats bundled plugins as plugin-boundary code, so WhatsApp-specific inbound and pairing behavior belongs in the WhatsApp plugin unless a missing SDK seam is proven. (extensions/AGENTS.md:1, e5123e44b0f5)
    • Vision fit: VISION.md prioritizes security and safe defaults, matching the reported unsolicited outbound WhatsApp pairing-message behavior. (VISION.md:15, e5123e44b0f5)
    • Live issue context: The reporter says @openclaw/whatsapp v2026.6.10 sent the standard pairing reply to two contacts during Gateway restarts, with no user or agent action.
    • Current pairing send path: For an unknown direct sender under dmPolicy: pairing, checkInboundAccessControl creates a WhatsApp pairing request and calls sock.sendMessage with the pairing reply. (extensions/whatsapp/src/inbound/access-control.ts:134, e5123e44b0f5)
    • Current no-content guard: normalizeInboundMessage drops Baileys upserts without extractable inbound user content before access control, which fixes the older no-content path but still allows content-bearing direct events into pairing access control. (extensions/whatsapp/src/inbound/monitor.ts:826, e5123e44b0f5)

    Likely related people:

    • hclsys: Authored the merged WhatsApp content-gate PR that added the current hasInboundUserContent guard for unsolicited pairing replies. (role: recent feature owner; confidence: high; commits: 46783d41e92f, 53bd5d6bd29e, 236c04dd71a4; files: extensions/whatsapp/src/inbound/extract.ts, extensions/whatsapp/src/inbound/monitor.ts, extensions/whatsapp/src/inbound/extract.test.ts)
    • mcaxtr: Contributed review/refactor commits in the merged no-content pairing gate and has recent WhatsApp inbound/access-control work connected to this behavior. (role: recent reviewer and adjacent owner; confidence: high; commits: 46783d41e92f, c5e4a804fe86, 61506e143967; files: extensions/whatsapp/src/inbound/access-control.ts, extensions/whatsapp/src/inbound/monitor.ts, extensions/whatsapp/src/inbound/extract.ts)
    • vincentkoc: Owns the open maintainer PR for broader unpaired-response configuration, which is adjacent to but not a replacement for this reconnect misdelivery report. (role: adjacent security-response owner; confidence: medium; commits: 1587b4279a3b; files: src/pairing/pairing-messages.ts, src/pairing/pairing-challenge.ts, src/config/types.channel-messaging-common.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 26, 2026
  3. openclaw-barnacle commented on Jul 11, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  4. openclaw-barnacle commented on Jul 19, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

  5. locked as resolved and limited conversation to collaborators on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions