fix(dashboard): secure loopback public URL proxy mode - #72127
Conversation
Related: #42344 and #68251 implement the same configured-public-host family. This PR additionally forces the auth gate for an external declared public URL and covers HTTP plus WebSocket validation, so the maintainer should choose the intended proxy/auth contract rather than treating the implementations as duplicates. |
|
Thanks for the focused reverse-proxy hardening. The underlying gap is present on current main: HTTP validation only accepts loopback aliases for loopback binds at Problems
Suggested changes
Automated hermes-sweeper review. |
92daadf to
9d2915a
Compare
Addressed in
|
|
looks mergeable The PR coherently closes the loopback reverse-proxy exposure: it snapshots the operator-declared public hostname, enables the existing auth gate before serving, removes SPA token injection in gated mode, and applies the same exact-host rule to HTTP and every dashboard WebSocket upgrade. Targeted gate, host, and unified-launch tests plus bytecode compilation passed; no source-backed security finding remains. Security evidence:
Review setup: I reviewed a run-owned local rebase or patch replay against current GitHub Not checked:
Signed: GPT-5.6-luna-max in Codex |
Summary
dashboard.public_urlas a trusted dashboard Host/Origin when the backend is bound to loopback.Testing
PYTHONPATH="$PWD" python -m pytest tests/hermes_cli/test_dashboard_auth_*.py tests/hermes_cli/test_dashboard_unified_launch.py tests/hermes_cli/test_web_server_host_header.py -o 'addopts=' -q— 142 passedruff checkon all changed Python filespy_compileon all changed Python filesgit diff --check origin/main...HEADNotes
*.ts.nethostname can proxy to a loopback dashboard without exposing it to the public internet.0.0.0.0, or unconditional trust in forwarded headers.