Skip to content

Remove the WebSocket browser-origin boundary - #23

Merged
powerfooI merged 1 commit into
mainfrom
fix/remove-ws-origin-boundary
Aug 20, 2026
Merged

Remove the WebSocket browser-origin boundary#23
powerfooI merged 1 commit into
mainfrom
fix/remove-ws-origin-boundary

Conversation

@powerfooI

Copy link
Copy Markdown
Owner

Problem

The browser-origin check added in #18 (released in 0.4.0) accepts WebSocket upgrades only when the Origin host matches the request host. Reverse proxies that terminate TLS and forward to an internal address rewrite the Host header, so every browser connecting through such a proxy is rejected and the UI sits at "Browser disconnected from bridge". HTTP is unaffected, so the page loads but the bridge never connects.

Changes

  • Delete the /ws origin check and its module (supersedes the allowlist added in Allow WebSocket origins behind Host-rewriting reverse proxies #22, which is removed with it).
  • SECURITY.md now states the trust model explicitly: the bridge performs no browser-origin or request-host checks; requests that reach the listener (and pass authentication, when required) have full authority. Deployments secure the access path themselves — strong password, TLS at the proxy, VPN, or firewall.

This mirrors the 0.3.2 decision (#2) for the HTTP path and keeps reverse-proxy deployments working without any GUI-side configuration.

Verification

  • bun run precommit (format, lint, typecheck, 557 tests) green
  • Live check: a WebSocket upgrade with a rewritten Host header and a public-site Origin now completes (101) with no configuration

The origin check added in 0.4.0 rejects browser WebSocket upgrades
whose Origin host differs from the request host. Reverse proxies that
terminate TLS and forward to an internal address rewrite the Host
header, so browsers behind them could not connect at all.

Drop the check entirely, matching the 0.3.2 decision for the HTTP
path: access control is the deployment's responsibility
(authentication, HTTPS at the proxy, VPN, firewall), now stated
explicitly in SECURITY.md.
@powerfooI
powerfooI merged commit 70a1c60 into main Aug 20, 2026
1 check passed
@powerfooI
powerfooI deleted the fix/remove-ws-origin-boundary branch August 20, 2026 07:06
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