fix(ui): keep shared auth on insecure control-ui connects#45088
fix(ui): keep shared auth on insecure control-ui connects#45088velvet-shark merged 1 commit intomainfrom
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟠 Control UI sends shared token/password over potentially plaintext WebSocket in insecure contexts
DescriptionIn
Vulnerable flow:
RecommendationPrevent shared credentials from being sent over plaintext transport. Suggested hardening (client-side):
Example: const gatewayUrl = new URL(this.opts.url, window.location.href);
const isWsPlaintext = gatewayUrl.protocol === "ws:";
const isLoopback = ["localhost", "127.0.0.1", "::1"].includes(gatewayUrl.hostname);
const explicitGatewayToken = this.opts.token?.trim() || undefined;
const explicitPassword = this.opts.password?.trim() || undefined;
if (isWsPlaintext && !isLoopback && (explicitGatewayToken || explicitPassword)) {
throw new Error("Refusing to send credentials over ws://; use wss://");
}Server-side guidance (docs/config):
Analyzed PR: #45088 at commit Last updated on: 2026-03-13T13:43:24Z |
Greptile SummaryThis PR fixes a bug where plain-HTTP (insecure context) Control UI sessions dropped explicit shared token/password auth before the first WebSocket Root cause: Fix: Pre-populate Key points:
Confidence Score: 5/5
Last reviewed commit: e5fbf3d |
6a34bf0 to
e27b2dd
Compare
e27b2dd to
99eb3fd
Compare
|
Merged via squash.
Thanks @velvet-shark! |
* main: (168 commits) fix: stabilize macos daemon onboarding fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) docs(plugins): clarify workspace shadowing fix(node-host): harden perl approval binding fix(node-host): harden pnpm approval binding fix(discovery): add missing domain to wideArea Zod config schema (openclaw#35615) chore(gitignore): add docker-compose override (openclaw#42879) feat(ios): add onboarding welcome pager (openclaw#45054) fix(signal): add groups config to Signal channel schema (openclaw#27199) fix: restore web fetch firecrawl config in runtime zod schema (openclaw#42583) fix: polish Android QR scanner onboarding (openclaw#45021) fix(android): use Google Code Scanner for onboarding QR fix(config): add missing params field to agents.list[] validation schema (openclaw#41171) docs(contributing): update Android app ownership fix(agents): rephrase session reset prompt to avoid Azure content filter (openclaw#43403) test(config): cover requiresOpenAiAnthropicToolPayload in compat schema fixture fix(agents): respect explicit user compat overrides for non-native openai-completions (openclaw#44432) Android: fix HttpURLConnection leak in TalkModeVoiceResolver (openclaw#43780) Docker: add OPENCLAW_TZ timezone support (openclaw#34119) fix(agents): avoid injecting memory file twice on case-insensitive mounts (openclaw#26054) ...
* fix(node-host): harden pnpm approval binding * fix(node-host): harden perl approval binding * docs(plugins): clarify workspace shadowing * fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark * docs: add Claude Code token efficiency playbook * docs: compress playbook for agent consumption * docs: restructure playbook for long-context patterns * pre-commit: add incremental repo-map updater Auto-updates docs/repo-map.json exports and dependencies when src/ or extensions/ .ts files are committed. Preserves existing purpose fields, removes deleted files, adds new files with empty purpose. Regex-based extraction, no dependencies. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Radek Sienkiewicz <[email protected]> Co-authored-by: velvet-shark <[email protected]>
…5088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark
…5088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark
…5088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark
…5088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark
* fix(node-host): harden pnpm approval binding * fix(node-host): harden perl approval binding * docs(plugins): clarify workspace shadowing * fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark * docs: add Claude Code token efficiency playbook * docs: compress playbook for agent consumption * docs: restructure playbook for long-context patterns * pre-commit: add incremental repo-map updater Auto-updates docs/repo-map.json exports and dependencies when src/ or extensions/ .ts files are committed. Preserves existing purpose fields, removes deleted files, adds new files with empty purpose. Regex-based extraction, no dependencies. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Radek Sienkiewicz <[email protected]> Co-authored-by: velvet-shark <[email protected]>
…5088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark
* fix(node-host): harden pnpm approval binding * fix(node-host): harden perl approval binding * docs(plugins): clarify workspace shadowing * fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark * docs: add Claude Code token efficiency playbook * docs: compress playbook for agent consumption * docs: restructure playbook for long-context patterns * pre-commit: add incremental repo-map updater Auto-updates docs/repo-map.json exports and dependencies when src/ or extensions/ .ts files are committed. Preserves existing purpose fields, removes deleted files, adds new files with empty purpose. Regex-based extraction, no dependencies. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Radek Sienkiewicz <[email protected]> Co-authored-by: velvet-shark <[email protected]>
* fix(node-host): harden pnpm approval binding * fix(node-host): harden perl approval binding * docs(plugins): clarify workspace shadowing * fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark * docs: add Claude Code token efficiency playbook * docs: compress playbook for agent consumption * docs: restructure playbook for long-context patterns * pre-commit: add incremental repo-map updater Auto-updates docs/repo-map.json exports and dependencies when src/ or extensions/ .ts files are committed. Preserves existing purpose fields, removes deleted files, adds new files with empty purpose. Regex-based extraction, no dependencies. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Radek Sienkiewicz <[email protected]> Co-authored-by: velvet-shark <[email protected]>
…5088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark
* fix(node-host): harden pnpm approval binding * fix(node-host): harden perl approval binding * docs(plugins): clarify workspace shadowing * fix(ui): keep shared auth on insecure control-ui connects (openclaw#45088) Merged via squash. Prepared head SHA: 99eb3fd Co-authored-by: velvet-shark <[email protected]> Co-authored-by: velvet-shark <[email protected]> Reviewed-by: @velvet-shark * docs: add Claude Code token efficiency playbook * docs: compress playbook for agent consumption * docs: restructure playbook for long-context patterns * pre-commit: add incremental repo-map updater Auto-updates docs/repo-map.json exports and dependencies when src/ or extensions/ .ts files are committed. Preserves existing purpose fields, removes deleted files, adds new files with empty purpose. Regex-based extraction, no dependencies. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Radek Sienkiewicz <[email protected]> Co-authored-by: velvet-shark <[email protected]>
Summary
connectframe, so the gateway rejected them withdevice identity required.allowInsecureAuth+dangerouslyDisableDeviceAuthtoken flow for self-hosted HTTP deployments even though same-tab refresh/navigation had already been fixed separately.#40892sessionStorage same-tab behavior or add any cross-tab token sharing.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
dangerouslyDisableDeviceAuth: trueignored in 2026.3.11 — Control UI rejects HTTP connections with "device identity required" #44485User-visible / Behavior Changes
http://first-connect flows instead of dropping auth before the first WebSocket handshake.Security Impact (required)
No)Yes)No)No)No)Yes, explain risk + mitigation:This restores the explicit token/password that the operator already supplied to the existing first-connect frame on insecure Control UI sessions. It does not broaden cached device-token fallback, does not add storage, and keeps the trusted retry boundary unchanged.
Repro + Verification
Environment
gateway.auth.mode: "token",gateway.controlUi.allowInsecureAuth: true,gateway.controlUi.dangerouslyDisableDeviceAuth: trueSteps
connect.challengeevent.connectrequest payload.Expected
connectframe includes the explicit shared token or password.Actual
connectframe from an empty auth selection state, soparams.authwas omitted entirely.Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
http://connect with explicit shared token now sendsauth.tokenhttp://connect with explicit shared password now sendsauth.password#40892still passdeviceTokenReview Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
60abd798cffa99a9f03ac9936c47e8dc3f87decaui/src/ui/gateway.tsandui/src/ui/gateway.node.test.tsdevice identity required, or cached device tokens start appearing on the first insecure connectRisks and Mitigations
deviceTokenstays absent.