Repository navigation
Conversation
The API has no authentication and answered every origin with Access-Control-Allow-Origin: *, and the terminal WebSocket accepted any Origin. A web page open in the user's browser could list tasks, read logs, create and execute tasks, and type into a live agent's tmux pane. Replace the permissive CORS middleware with an origin guard: browser requests must target a local or tailnet Host (defeats DNS rebinding) and carry an Origin from our own clients (own UI, desktop shell, localhost dev servers, browser extensions). Non-browser clients send no Origin and are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Any web page open in the user's browser could drive the ty web API: CORS was
*on every route and the terminal WebSocket accepted any Origin. That let a page list tasks, read logs, create and run tasks, and type into a live agent's tmux pane.This replaces the permissive CORS middleware with an origin guard:
OriginorSec-Fetch-Siteheader) must target a local or tailnet Host: an IP, a single-label name,.localhost/.local/.lan/.home/.internal/.home.arpa/.ts.net. This blocks DNS rebinding.tauri://, a localhost or tailnet dev server, orchrome-extension:///moz-extension://.Tests:
go test ./internal/web/ ./cmd/...pass, including new cases for a foreign origin, a preflight, DNS rebinding (with and without an Origin header) and the terminal upgrader.🤖 Generated with Claude Code