harden: reject whitespace-only tmux socket_name in roster-v2 (silently selects default server) #794
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
requiredTmuxSocket()inpackages/mosaic/src/fleet/roster-v2.tstrimssocket_namebeforevalidating it against a permissive regex that accepts the empty string, so a whitespace-only value
(e.g.
socket_name: " ") is normalized to""and silently selects the operator's default tmuxserver instead of being rejected.
Detail (on
main)Consumption confirms the impact —
comms-onboarding.ts:and the intended contract is explicit in tests: "omits -L only for the literal default socket."
So a whitespace-only
socket_namebypasses the "explicit decision to use the default server" and canpoint fleet tmux operations (message/session/runtime) at an unintended shared namespace.
Severity
Low. Requires an operator to hand-author a whitespace-only
socket_name; no privilege escalation. Thisis input-validation hardening, not an active exploit. (Flagged by an automated Codex pass whose
"medium/blocker" rating is inflated for this path.)
Proposed fix
whose trimmed form differs from the source (i.e. reject whitespace-only and whitespace-padded values).
socket_name, assertingRosterV2ValidationError.Provenance
Surfaced as a byproduct of an independent review; pre-existing on
main, not introduced by anyopen PR (noted during PR #793 review, which it does not belong to). Filed to preserve the finding.