Skip to content

Warn on non-loopback web binds and document the token's access-control boundary - #2790

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/feat/2750-non-loopback-bind-warning
Oct 25, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/feat/2750-non-loopback-bind-warning

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2750

What changed

  • Startup warning (clients/web/server/web-server-config.ts): new nonLoopbackBindWarning(hostname, dangerouslyOmitAuth) returns a warning whenever the bind host is not loopback (via isLoopbackHost, so 127.0.0.0/8, ::1, localhost and their alternate spellings stay silent). printServerBanner prints it once, so the prod server, --dev, and the Docker image all print the same thing. The text says the token is not access control, that GET / hands it to anyone who loads the page, that this includes other local users on a shared host, and links to the README section. With DANGEROUSLY_OMIT_AUTH it says auth is disabled instead of mentioning the token.
  • README (clients/web/README.md, Hosting on a network): adds the access-control caveat — anyone who can load the page can act as you, a custom token doesn't help, and wider publishing needs an authenticating proxy / SSH tunnel / private network.
  • docs/docker.md: notes that the image always prints this warning (it binds 0.0.0.0 by design) and that the published port is what decides exposure.

Tests

web-server-config.test.ts: loopback names and IPs stay silent; wildcard, LAN IPv4, IPv6 and hostname binds warn with the README link; the auth-disabled wording; the banner prints the warning exactly once for a non-loopback bind and not at all for the default bind.

npm run local:gate passes.

The token-free bootstrap idea in the issue's follow-up section is left out, as the issue asks.

🤖 Generated with Claude Code

…-control boundary (#2750)

The startup banner now prints a one-time warning whenever the resolved bind
host is not loopback: the API token blocks cross-origin browser requests but
is not access control, since GET / hands it to anyone who can load the page.
The banner is shared by prod, --dev and the Docker image, so all three print
it. The web README's 'Hosting on a network' section and docs/docker.md carry
the same caveat.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused changes match the issue requirements, reuse existing host classification, and include regression coverage with no identified blocking defects.

No open issues 🎉

What changed in this PR

Addresses #2750 by warning about non-loopback web binds and clarifying that the API token does not restrict access for anyone who can load the Inspector UI. Authentication behavior is unchanged.

Changes:

  • Adds an exposure warning to the shared startup banner, with separate wording when authentication is disabled.
  • Tests loopback exemptions, non-loopback warnings, and one-time banner output.
  • Documents the access-control boundary and Docker port-publishing implications.
File Description
docs/​docker.md Explains the default container warning and published-port exposure.
clients/​web/​src/​test/​integration/​server/​web-server-config.test.ts Tests warning triggers, wording, documentation link, and banner output.
clients/​web/​server/​web-server-config.ts Adds the warning helper and shared banner integration.
clients/​web/​README.md Clarifies token limitations and recommends external access controls.

Review effort: Balanced

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 came back clean (no inline comments, nothing suppressed, approval recommended), so no further rounds requested.

@cliffhall
cliffhall merged commit a4f4dd4 into v2/main Oct 25, 2026
11 checks passed
@cliffhall
cliffhall deleted the v2/feat/2750-non-loopback-bind-warning branch October 25, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn on non-loopback web binds and document the token's access-control boundary in the README

2 participants