Skip to content

[reviewer] Review backlog (security): standbyAcked also survives the listener-removing disconnect paths that bypass the ws close handler #16466

Closed

Description

@hivecommons-hive

Blocked on PR #16465. This finding came from reviewing PR #16465 and is about code that PR is changing. Fix it in the PR, or leave it: when the PR merges the hive checks whether the finding is still on the base branch — closing this item as completed if its file or symbol is gone, lifting the block otherwise — and unblocks this item for re-triage if the PR is closed without merging. Once it is unblocked, check the finding still applies on the base branch; if it is already fixed, close this item without a PR.

Filed from an out-of-scope finding in the Hive review of PR #16465.

PR: #16465 (#16465)
Perspective: security
Severity: low (P3)
Finding: standbyAcked also survives the listener-removing disconnect paths that bypass the ws close handler
Evidence: bin/contributor-relay.js:2701

hub.authenticated = false;

The PR clears hub.standbyAcked in the ws 'close' handler (bin/contributor-relay.js:10181), satisfying #16463. Two other teardown paths never run that handler because they call hub.ws.removeAllListeners() first: the profile-switch disconnect (bin/contributor-relay.js:2695-2703, which resets authenticated/readyOutstanding and bumps connectGeneration) and the TLS host-mismatch redial (bin/contributor-relay.js:1561-1580, which resets authenticated then calls connectHub directly; connectHub at 10103 also removeAllListeners+terminate on the old socket). On those paths hub.standbyAcked stays true from the previous connection, so after re-auth a hub that no longer advertises standby_v1 (declareStandby early-returns at 9505-9508 without any standby_ack) would still pass the standbyPush gate at 9734. Same trust-boundary shape as the fixed close-handler case; the peer is the same authenticated hub URL, so impact is low. Remedy: reset hub.standbyAcked = false alongside hub.authenticated = false at 2701 and 1563.

Fingerprint: 7715c67db9e079c49dc1af2b230585b41302cbeecda4ee96f77bef23afb4c51e

filed by Hive review backlog

Activity

  1. added
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Nov 3, 2026
  2. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    Same file as #16463: both cite bin/contributor-relay.js, but this finding does not match that issue's symbol, line range or category, so it was filed separately instead of folded in.

    filed by Hive review backlog

  3. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 3, 2026
  4. removed
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 3, 2026
  5. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    Still present at 1b4a458 (style).

  6. removed
    blockedWaiting on something outside this repository; not contributor work until a human clears the label
    on Nov 3, 2026
  7. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

    Unblocked: #16465 is no longer open. This issue is actionable again.

    Already fixed on v6 by #16465 (merged as 0ed03ff97f52a8d5bb14f030196cab2980e4eeff). That commit addressed this finding inside the PR before merge: hub.standbyAcked = false is now reset alongside hub.authenticated = false on both listener-removing teardown paths the finding named — the TLS host-mismatch redial (bin/contributor-relay.js:1564) and the profile-switch disconnect (bin/contributor-relay.js:2706) — in addition to the ws close handler (:10186), with coverage in bin/contributor-relay.test.js.

    Verified against current v6:

    $ grep -n "standbyAcked = false" bin/contributor-relay.js
    1564:  hub.standbyAcked = false;
    2706:  hub.standbyAcked = false;
    10186:    hub.standbyAcked = false;
    

    Closing as not planned (no further change needed).


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 0ed03ff

    — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

  8. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    Unblocked: #16465 merged and the finding's file is still on the base branch. This item is actionable now; check the finding still applies first, and close it without a PR if it is already fixed.

  9. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 3, 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

    agent/reviewerFiled by the reviewer agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions