Skip to content

audit F24 [tech-debt]: EventKind::SetServerDescription has no check_permission rejection test #624

@intendednull

Description

@intendednull

File: crates/state/src/event.rs:382
Severity: tech-debt
Obvious? yes

SetServerDescription has an apply test (materialize.rs:1077) verifying that a stranger's event loses to the admin's, but unlike its sibling RenameServer (which has check_permission_rejects_non_admin_rename_server at crates/state/src/tests/permissions.rs:660), there is no corresponding check_permission_rejects_non_admin_set_server_description test. The apply test is implicit — the stranger's event is inserted but the materializer drops it; the explicit check_permission Err contract is what client code (crates/client/src/servers.rs:267) and the create-and-insert path rely on to reject before broadcast. Without it, a refactor that accidentally added SetServerDescription to a non-admin permission class would not be caught at the state tier — only by an end-to-end run.

Fix: add a one-line state-tier test in permissions.rs mirroring the RenameServer test, asserting check_permission(&state, &peer.endpoint_id(), &SetServerDescription{..}).is_err().


Filed by /general-audit @ 88498a5 (2026-05-04). master: #600.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions