Skip to content

fix(dashboard): allow desktop websocket origins on remote binds#37644

Closed
DanBennettUK wants to merge 1 commit into
NousResearch:mainfrom
DanBennettUK:fix/desktop-ws-non-web-origins
Closed

fix(dashboard): allow desktop websocket origins on remote binds#37644
DanBennettUK wants to merge 1 commit into
NousResearch:mainfrom
DanBennettUK:fix/desktop-ws-non-web-origins

Conversation

@DanBennettUK

Copy link
Copy Markdown

Summary

  • allow authenticated dashboard WebSocket upgrades from Electron/Desktop non-web origins (file://, null, app://, hermes://) when the dashboard is explicitly bound to a non-loopback host
  • keep Host-header validation in place so the request must still target the bound dashboard interface
  • keep token/ticket validation in place and continue rejecting hostile http/https origins

Context

Hermes Desktop can connect from an Electron renderer origin such as file://. When using the dashboard remotely over a trusted private transport, the dashboard may be bound to a specific non-loopback address instead of localhost. The previous WebSocket origin guard rejected those Desktop origins with 403 even when a valid dashboard session token was supplied.

This is framed as authenticated Desktop remote access rather than a Tailscale-specific special case.

Test plan

  • python -m py_compile hermes_cli/web_server.py
  • python -m pytest tests/hermes_cli/test_web_server_host_header.py -q -o 'addopts='\n\nLocal result: 17 passed, 1 warning.\n

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard type/security Security vulnerability or hardening and removed type/bug Something isn't working labels Jun 2, 2026
@DanBennettUK

DanBennettUK commented Jun 3, 2026

Copy link
Copy Markdown
Author

Closing this as superseded by the recent upstream Desktop/WebSocket origin changes.

The current implementation of hermes_cli.web_server._ws_host_origin_is_allowed already accepts authenticated non-web Desktop origins such as file://, null, and custom app schemes across the relevant modes, while still host-checking normal browser/http origins. That covers the issue this PR was trying to fix, so no need for maintainers to spend time reviewing this branch.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants