Skip to content

[codex] Block banned actors from moderation commands (BUZZ-SEC-007)#1915

Open
jmecom wants to merge 1 commit into
mainfrom
codex/fix-buzz-sec-007
Open

[codex] Block banned actors from moderation commands (BUZZ-SEC-007)#1915
jmecom wants to merge 1 commit into
mainfrom
codex/fix-buzz-sec-007

Conversation

@jmecom

@jmecom jmecom commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What changed

Moderation commands now check the actor's durable, tenant-scoped ban state before executing any mutation. This closes the HTTP and stale-WebSocket paths that let a banned administrator reach an unban command without completing a fresh authentication challenge.

Timeouts remain distinct from bans: an authorized moderator who is timed out can still lift that timeout, while a banned actor cannot run any moderation command.

Why

Moderation commands intentionally run before the ordinary write-restriction gate so administrators can remove timeouts. The code assumed every banned actor had already been rejected by WebSocket authentication, but NIP-98 requests and already-authenticated sockets could reach the handler without that check. A banned administrator could therefore unban themselves and regain normal relay access.

Impact

Ban enforcement now applies at the moderation mutation boundary on every transport. Database failures while checking the ban state reject the command rather than allowing it through.

Testing

  • cargo test -p buzz-relay banned_admin_cannot_reach_an_unban_command --lib

Addresses BUZZ-SEC-007.

@jmecom
jmecom marked this pull request as ready for review July 15, 2026 18:17
@jmecom
jmecom requested a review from a team as a code owner July 15, 2026 18:17
@jmecom
jmecom force-pushed the codex/fix-buzz-sec-007 branch 2 times, most recently from a5cf051 to 5c7fb97 Compare July 15, 2026 22:37
@jmecom
jmecom force-pushed the codex/fix-buzz-sec-007 branch from 5c7fb97 to 3965125 Compare July 16, 2026 20:32
@jmecom
jmecom force-pushed the codex/fix-buzz-sec-007 branch from 3965125 to defa8fc Compare July 16, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants