Remove the WebSocket browser-origin boundary - #23
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The browser-origin check added in #18 (released in 0.4.0) accepts WebSocket upgrades only when the
Originhost matches the request host. Reverse proxies that terminate TLS and forward to an internal address rewrite theHostheader, 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
/wsorigin check and its module (supersedes the allowlist added in Allow WebSocket origins behind Host-rewriting reverse proxies #22, which is removed with it).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) greenHostheader and a public-siteOriginnow completes (101) with no configuration