Security: harden cluster admin_proof replay without breaking plaintext accounting - #169
Open
cursor[bot] wants to merge 8 commits into
Open
Security: harden cluster admin_proof replay without breaking plaintext accounting#169cursor[bot] wants to merge 8 commits into
cursor[bot] wants to merge 8 commits into
Conversation
…eat counts - Track recently accepted admin_proof digests per node so captured ClientWrite/membership proofs cannot be replayed while the API token is unchanged. - Ignore heartbeat-supplied session counts on plaintext clusters; only mTLS-bound peers may update remote play/publish load used for admission. Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
AlexanderWagnerDev
marked this pull request as ready for review
August 19, 2026 04:57
Contributor
Author
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit af27deb. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Harden cluster
admin_proofreplay handling while preserving the existing plaintext cluster accounting behavior.Security
admin_proofdigests per node for 10 minutes.Plaintext cluster behavior
CLUSTER_SECRET+ Raft membership as its documented trust boundary; mTLS adds stronger per-node certificate identity.CLUSTER_TLS_ENABLED=falsesetup.The earlier version of this PR disabled all remote session-count caching for plaintext clusters; that regression has been removed.
Note
Medium Risk
Touches cluster authentication and admin/join forwarding paths; incorrect replay or join consumption logic could block legitimate ops or leave a narrow replay window.
Overview
Hardens cluster
admin_proofhandling so captured control-plane proofs cannot be replayed while the API bearer token is unchanged.Proofs are minted as
{nonce}.{mac}, where the MAC covers{nonce}:{payload}, so each legitimate retry gets a new cache key but a stolen proof cannot be re-signed. Each node keeps a 10-minuteused_admin_proofsmap: non-join proofs are marked used on first successful verification;Join:proofs stay retryable untilaccept_join(or successful leader forward) callsconsume_admin_proof.Plaintext clustering still records heartbeat publisher/player and per-stream/per-viewer counts on every node (documented as required for totals, limits, and drain/delete accounting); mTLS-only behavior for updating routing addresses from heartbeats is unchanged.
Adds unit tests for proof minting, TTL purge, and deterministic
admin_proof(motivating the replay cache).Cargo.lockbumps minor dependency versions only.Reviewed by Cursor Bugbot for commit 40922e3. Bugbot is set up for automated code reviews on this repo. Configure here.