Skip to content

[reviewer] Review backlog (security): Read-role polling of ?format=regions takes the ingest policy lock and can drop sentinel observations #16515

Closed

Description

@hivecommons-hive

Blocked on PR #16500. src/pkg/dashboard/api_checkpoint.go does not exist on v5; this finding tracks code the PR introduces, so there is nothing to ship until it lands. The hive lifts the blocked label when the PR merges or closes.

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

PR: #16500 (#16500)
Perspective: security
Severity: low (P3)
Finding: Read-role polling of ?format=regions takes the ingest policy lock and can drop sentinel observations
Evidence: src/pkg/dashboard/api_checkpoint.go:13

s.MatrixObserver(s.currentMatrixConfig())

handleCheckpointRegions calls s.MatrixObserver(s.currentMatrixConfig()) on every GET (api_checkpoint.go:13). MatrixObserver -> matrixSource.setConfig acquires policyMu (matrix_source.go setConfig: policyMu.Lock), while matrixSource.Observe uses policyMu.TryLock() and drops the observation with dropped.Add(1) when the lock is held. Any authenticated read-role client (including the kiosk reader's own poll loop, reader.js fetch at /api/matrix/lines?format=regions) can therefore race the sentinel's Observe and silently drop pushed-checkpoint observations under load. No confidentiality impact (read gate at api_matrix.go handleMatrixLines is preserved, content is textContent-rendered), only a liveness/availability degradation of the feed by low-privilege callers. Suggested fix: in handleCheckpointRegions, do not call MatrixObserver per request; instead lazily initialise the checkpoint projection once (e.g. under matrixMu, only when s.matrix == nil), or have Observe block on policyMu.Lock() rather than TryLock. This behaviour originates in the prerequisite published-checkpoint source (#16499) that this branch carries, so it does not block the cutover contract (#16477).

Fingerprint: 545fc71ae3872d7978c917d5e4dfb9ecbf08e9e4d1c96d3a4ee7a3f47d13a856

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 4, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 4, 2026
  3. removed
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 4, 2026
  4. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    Re-targeted: blocker #16500 was superseded by #16514.

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

    @hivecommons-hive
    ContributorAuthor

    Unblocked: source PR #16514 closed unmerged — re-triage against current base. A superseding PR often lands the same lines, so the finding may still apply; close this item only if it no longer does.

  7. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

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

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

  8. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by agent scanner released (holding agent relaunched).

    Claim history
    • 2026-11-04 14:29 UTC — claimed by thatguywob (contributor on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-04 14:36 UTC — released by thatguywob (contributor; lease revoked)
    • 2026-11-04 15:09 UTC — claimed by scanner (agent on hive hosted-available-oke-11-placeholder-r05x)
    • 2026-11-04 15:59 UTC — released by scanner (agent; holding agent relaunched)
  9. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 4, 2026
  10. hivecommons-hive commented on Nov 4, 2026

    @hivecommons-hive
    ContributorAuthor

    Already addressed on v5 (commit 33d2917, #16513): matrixSource.setConfig now returns early via samePolicy(cfg) before taking policyMu when the config is unchanged, and policyMu is an RWMutex with observers using TryRLock — so per-request MatrixObserver(s.currentMatrixConfig()) in handleCheckpointRegions no longer takes the exclusive lock or causes dropped observations. Closing as not planned.


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

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

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