Repository navigation
fix(light/proxy)!: require configured WebSocket origins - #1453
Conversation
Preserve Origin-less clients and reuse RPC origin matching without implicit same-host trust for the light proxy. Co-authored-by: Codex <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 14th in line, estimated start in ~2.6 h (commit cde8567)
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
Reviewed the complete assigned range for the configured WebSocket-origin restriction in both light-proxy serving modes. The implementation and associated tests correctly enforce the explicit allow-list for Origin-bearing browser connections while preserving Origin-less clients and existing RPC origin behavior; no in-scope defects were found.
Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
Review provenance
- Triage:
criticalbygpt-6-astra(effort low) — This is a security-sensitive networking change that alters browser access control for light-proxy WebSocket endpoints across multiple serving modes, where origin-validation bugs could expose operators to cross-site access despite the implementation being relatively contained. - Phase 1 reviewers: not run (skipped for throughput: 18 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— tenderdash-consensus-security (completed, effort xhigh); agentphase2-reviewer
Retain both the light-proxy origin policy and committed-block recovery entries in the 1.8.0 changelog. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
TL;DR: Browser connections to the light proxy now require an explicitly permitted origin. Non-browser clients remain supported.
User story
As a node operator, I want to choose which websites can connect to my light proxy.
Scenario
The light proxy currently accepts WebSocket connections from any website. After this change, browser origins must match the configured list, including same-host origins. Clients without an Origin header continue to work.
Detailed discussion
Issue being fixed or feature implemented
Extracts the useful WebSocket-origin restriction from closed PR #1382 into a standalone change based on current
v1.8-dev. PR #1343 introduced the shared origin checker but deliberately retained allow-all behavior for the light proxy. No other open PR covering this fix was found.What was done?
rpc.cors-allowed-originsthrough the CLI.*is an explicit operator opt-in to allow all.This change does not provide authentication or authorization. It changes no light-client witness policy or consensus threshold behavior.
How Has This Been Tested?
make test PACKAGES='./rpc/jsonrpc/server ./light/proxy ./cmd/tenderdash/commands': passed, with CGO and-tags deadlockas supplied by the Makefile.make lint LINT_BASE=origin/v1.8-dev: passed, zero issues.gofmtandgit diff --check: passed.BLS_DIR=/home/ubuntu/git/tenderdash/third_party/bls-signaturesand a writable Go build cache. Full logs are retained locally.Breaking Changes
Browser WebSocket clients must configure their origin in
rpc.cors-allowed-origins, including browsers served from the proxy host. Applications constructingProxydirectly can setAllowedOriginsbefore serving. An explicit*restores the previous allow-all policy but removes the origin restriction. Origin-less clients are unaffected.Checklist:
For repository code-owners and collaborators only
🤖 Co-authored by Claudius the Magnificent AI Agent