Skip to content

server: a queued chord or text can still write after its sender's authority lapses during the RPC connect #545

Closed

Description

@devswha

What

A queued terminal chord or text passes the attachment, claim and authorization checks inside serialize(...), then waits for the herdr RPC's Unix socket to connect (herdrRpc in server/herdr/client.ts, Bun.connect). If the sender detaches, switches to observe, or has its device revoked during that wait, the request still writes pane.send_keys / pane.send_text when the connection resolves: nothing re-checks authority immediately before sock.write.

The window is the socket connect, normally well under a millisecond on a local herdr, so it is not reachable from the UI in practice. It is the same shape for every RPC the server issues after authorizeSocket, not only keys.

Where

  • server/index.ts, the keys and input handlers (the checks run before paneSendKeys / paneSendText).
  • server/herdr/client.ts, herdrRpc: the write happens after the awaited connect.

Possible fix

Carry a guard (a function or an AbortSignal tied to the attachment claim and the connection's authority) into the RPC helper and check it right before sock.write; requests whose authority is gone are dropped and answered input_failed.

Found by

Codex gpt-6.1-sol adversarial review of #508 at 471db0c (Medium). Pre-existing; not changed by #508.

Activity

  1. added a commit that references this issue on Oct 9, 2026
    49d275f
  2. added a commit that references this issue on Oct 9, 2026
    54921e3
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions