Skip to content

Refuse input from sessions without host permission - #30

Open
masnwilliams wants to merge 1 commit into
masterfrom
hypeship/view-only-non-host-guards
Open

masnwilliams wants to merge 1 commit into
masterfrom
hypeship/view-only-non-host-guards

Conversation

@masnwilliams

@masnwilliams masnwilliams commented Oct 27, 2026 •

Copy link
Copy Markdown

Summary

Refuse input from sessions whose member profile doesn't have host permission (can_host: false), so a view-only member can watch without controlling the desktop.

  • LegacyIsHost() returns false when the profile can't host. Otherwise it keeps its existing behavior: true under implicit hosting, or when the session is the host.
  • clipboardSet, keyboardMap and keyboardModifiers require can_host (clipboard set also requires can_access_clipboard).
  • controlRelease requires can_host.

The checks use the profile's can_host rather than IsHost(), because with legacy implicit hosting a session that may control isn't necessarily registered as the host.

Sessions that can host behave as before, including the default admin and user profiles.

Tests

New unit tests:

  • internal/session: LegacyIsHost with and without implicit hosting, for profiles that can and can't host.
  • internal/websocket/handler: a session without host permission is refused for control request/release, move, key press, clipboard set, keyboard map and keyboard modifiers, with no desktop calls and no host change. A host-capable session still reaches the desktop for each.
  • internal/webrtc: legacy data-channel move, key down and button down are dropped for a session without host permission and applied for a host-capable one.

go vet ./internal/... and go test ./... pass in the server build image.

@masnwilliams masnwilliams changed the title Refuse input from sessions that cannot host Refuse input from sessions without host permission Oct 27, 2026

This branch has not been deployed

No deployments
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.

1 participant