Skip to content

[codex] Fix dashboard Host allowlist for loopback reverse proxies - #38766

Closed
iseff wants to merge 1 commit into
NousResearch:mainfrom
iseff:fix/dashboard-tailscale-host-header
Closed

[codex] Fix dashboard Host allowlist for loopback reverse proxies#38766
iseff wants to merge 1 commit into
NousResearch:mainfrom
iseff:fix/dashboard-tailscale-host-header

Conversation

@iseff

@iseff iseff commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • add an explicit loopback-only dashboard Host allowlist for trusted reverse proxies such as Tailscale Serve
  • wire hermes dashboard --allowed-host plus HERMES_DASHBOARD_ALLOWED_HOSTS and dashboard.allowed_hosts
  • extend the Host-header regression tests for HTTP, WebSocket, and config/env resolution

Root cause

The dashboard's DNS-rebinding guard correctly rejected non-loopback Host headers when the backend was bound to 127.0.0.1, but that also blocked legitimate requests arriving through a trusted loopback reverse proxy or Tailscale Serve MagicDNS hostname.

What changed

  • normalize Host / Origin / allowlist matching case-insensitively while stripping ports and handling IPv6 bracket notation
  • keep the default loopback DNS-rebinding protection intact and only consult the operator allowlist for loopback binds
  • leave explicit non-loopback and 0.0.0.0 behavior unchanged
  • document the safe path in CLI help and config comments without broadening --insecure

Validation

  • scripts/run_tests.sh tests/hermes_cli/test_web_server_host_header.py tests/hermes_cli/test_dashboard_auth_gate.py tests/hermes_cli/test_dashboard_auth_ws_auth.py
  • ruff check hermes_cli/web_server.py hermes_cli/main.py hermes_cli/config.py tests/hermes_cli/test_web_server_host_header.py tests/hermes_cli/test_dashboard_auth_gate.py

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels Jun 4, 2026
@iseff
iseff force-pushed the fix/dashboard-tailscale-host-header branch from f415f2b to 128b6d4 Compare June 4, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants