Skip to content

id DoS catalogue: presence boundary oracle contradicts PresenceTable truncation — over-bound heartbeats are accepted with 64 channels, not dropped (PR #7738 review finding) #8063

Closed

Description

@dezren39

id DoS catalogue: presence boundary oracle contradicts PresenceTable truncation (over-bound heartbeats are accepted, not dropped)

Finding (from PR review)

On PR #7738 (docs(id): record DoS scenario catalogue for #5892), Codex review comment 4506648818 (chatgpt-codex-connector[bot], 2026-11-08T15:00:03Z, doc/2026-11-08_decision_id5892_dos_scenario_catalogue.md:67):

Match the presence boundary oracle to channel truncation. For a correctly signed heartbeat containing 65 channels, the existing receiver does not drop the heartbeat: PresenceTable::update_at in pkgs/id/src/chat_presence.rs:282-312 deduplicates and membership-filters channels, retains at most 64, and accepts the resulting heartbeat. receive_presence_heartbeat verifies the signature before calling this normalization path. Requiring over-bound heartbeats to be dropped would therefore make the planned regression gate fail against intentional current behavior. Specify bounded retained channels as the oracle, keeping invalid-signature rejection separate, or explicitly identify rejection as a proposed protocol change.

No-response evidence

  • No replies in the comment thread; the review thread is unresolved (GraphQL reviewThreads verified 2026-11-09: thread for comment 4506648818 has isResolved: false).
  • PR docs(id): record DoS scenario catalogue for #5892 #7738 head is unchanged at 13935742d16959fa87ef6cfdedf4391c437f0f11 since the comment; no fix commit followed it. The Codex review summary on the PR records has_unresolved_findings: true. The finding is past the 24-hour grace period for open PRs.

Still-live evidence (current PR head)

Raw reads at head 13935742d1 agree:

  • The catalogue's Presence profile states: "including heartbeat with 64 channels and with 65; the channel bound is 64 (pkgs/id/src/chat_presence.rs). Over-bound/invalid signatures are dropped" — conflating the over-bound case with the invalid-signature case.
  • pkgs/id/src/chat_presence.rs update_at (lines ~282-312): the channel loop breaks once channels.len() >= MAX_HEARTBEAT_CHANNELS, deduplicates and membership-filters, rebuilds the heartbeat with the truncated channel set, inserts it, and returns true (accepted). A correctly signed 65-channel heartbeat is accepted with 64 channels, not dropped.

Acceptance criteria

  • The catalogue's presence boundary oracle specifies bounded retained channels (truncate to 64 and accept) as the expected behavior for a correctly signed over-bound heartbeat, with invalid-signature rejection specified separately, OR the catalogue explicitly identifies drop-on-over-bound as a proposed protocol change.
  • Resolving by a documented decision on this issue is also acceptable.

Filed by the pr-comment-review job (run 2026-11-09 15:54 CST) under the queue cutover: labels applied at filing, standard agent note posted after filing, and a repo-task/v1 triage packet (kind: triage, priority 30) enqueued on repo-health-code-pilot.

Activity

  1. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 9, 2026
  2. developing-today commented on Nov 9, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 9, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 9, 2026
  5. dezren39 commented on Nov 9, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage findings — task 14422 (lane code-x)

    Verdict: defect CONFIRMED at PR #7738 head; documented decision taken; gated follow-up enqueued.

    Decision (per task 14422 acceptance, second route): the catalogue's presence oracle is truncate-and-accept — a correctly signed over-bound heartbeat is accepted with its retained channel set truncated to 64. Drop-on-over-bound is not current behavior and is not adopted; if it is ever wanted, it must be proposed explicitly as a protocol change. Invalid-signature rejection stays a separate oracle.

    Evidence (fresh, 2026-11-09 ~22:10Z, read on the laptop clone / GitHub at PR head):

    • Issue id DoS catalogue: presence boundary oracle contradicts PresenceTable truncation — over-bound heartbeats are accepted with 64 channels, not dropped (PR #7738 review finding) #8063 OPEN; no held / user/owned / do-not-merge / do-not-auto-edit labels. PR docs(id): record DoS scenario catalogue for #5892 #7738 (docs(id): record DoS scenario catalogue for id: design: DoS scenario catalogue per interface (from #5685) #5892) still OPEN at head 13935742d16959fa87ef6cfdedf4391c437f0f11 — unchanged since Codex comment 4506648818.
    • Catalogue at that head, doc/2026-11-08_decision_id5892_dos_scenario_catalogue.md ("Presence over gossip" profile): "including heartbeat with 64 channels and with 65; the channel bound is 64 (pkgs/id/src/chat_presence.rs). Over-bound/invalid signatures are dropped" — conflates the over-bound case with the invalid-signature case, exactly as the finding states.
    • pkgs/id/src/chat_presence.rs: MAX_HEARTBEAT_CHANNELS = 64 (line 77); PresenceHeartbeat::new truncates to 64 (line 119); PresenceTable::update_at (lines ~282-312) dedups and membership-filters channels, breaks at 64, inserts the rebuilt heartbeat, and returns true (accepted). Existing tests update_at_dedups_wire_channels_before_the_cap and update_at_keeps_every_distinct_channel_past_duplicate_fill pin dedup-before-cap as intentional.
    • pkgs/id/src/commands/serve.rs:2190 receive_presence_heartbeat: signature verification happens before update_at; a heartbeat whose signature does not verify is dropped (returns false). So invalid-signature = dropped, over-bound-but-valid = truncated + accepted — two different oracles.

    Fix (scoped, doc-only): on PR #7738's branch queue/10502-5892-dos-scenario-catalogue, rewrite that profile sentence so the 65-channel correctly signed case specifies bounded retained channels (truncate to 64, heartbeat accepted, valid member heartbeat remains visible and expires normally), with invalid-signature rejection specified separately. If PR #7738 has merged by the time the follow-up is claimed, apply the same edit to the doc on main in a new PR; if the in-branch fix already landed, verify-and-close issue #8063. Replying to / resolving the source Codex thread is out of scope (pr-comment-review job rules, per the task 14422 packet).

    Routing: follow-up small_fix task 14424 enqueued from this triage (gated on PR #7738 state as above). Task 14422 completes as triaged. Issue #8063 stays open for the follow-up fix (task 14424).

  6. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 9, 2026
  7. dezren39 commented on Nov 9, 2026

    @dezren39
    MemberAuthor

    Agent note - fixed in-branch on PR #7738 - Agent: queue worker (repo-worker-code), lane code-y - Session/ID: task 14424, repo-queue-worker-shift-y 2026-11-09 16:04 CST run. Task 14424 (small_fix, direct lane row 5622) for issue #8063: corrected the DoS catalogue Presence profile in doc/2026-11-08_decision_id5892_dos_scenario_catalogue.md on PR #7738's branch queue/10502-5892-dos-scenario-catalogue, commit aee427d. The profile now specifies that a correctly signed heartbeat with 65 channels is accepted with retained channels truncated to 64 (MAX_HEARTBEAT_CHANNELS, pkgs/id/src/chat_presence.rs update_at - verified fresh at lines 77/119/285), and that invalid-signature heartbeats are dropped separately (receive_presence_heartbeat, pkgs/id/src/commands/serve.rs:2190). Doc-only; no Rust changes; the source Codex thread on PR #7738 was not replied to or resolved per the packet. Closing issue #8063 per task 14424 acceptance (fix landed in-branch, landing PR #7738 linked); PR #7738 itself remains open for its own #5892 lifecycle.

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

    priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions