Repository navigation
Warn on non-loopback web binds and document the token's access-control boundary - #2790
Merged
Merged
Conversation
…-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]>
There was a problem hiding this comment.
🟢 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
Member
Author
|
Copilot review loop closed: round 1 came back clean (no inline comments, nothing suppressed, approval recommended), so no further rounds requested. |
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.
Closes #2750
What changed
clients/web/server/web-server-config.ts): newnonLoopbackBindWarning(hostname, dangerouslyOmitAuth)returns a warning whenever the bind host is not loopback (viaisLoopbackHost, so127.0.0.0/8,::1,localhostand their alternate spellings stay silent).printServerBannerprints 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, thatGET /hands it to anyone who loads the page, that this includes other local users on a shared host, and links to the README section. WithDANGEROUSLY_OMIT_AUTHit says auth is disabled instead of mentioning the token.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 binds0.0.0.0by 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:gatepasses.The token-free bootstrap idea in the issue's follow-up section is left out, as the issue asks.
🤖 Generated with Claude Code