Skip to content

fix: grant administrator access through host-issued Control UI links - #119785

Merged
shakkernerd merged 3 commits into
mainfrom
fix/control-ui-owner-handoff
Aug 6, 2026
Merged

shakkernerd merged 3 commits into
mainfrom
fix/control-ui-owner-handoff

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

Fixes #119781

What Problem This Solves

Fixes an issue where operators opening the Control UI through openclaw dashboard or graphical onboarding received a durable browser credential without operator.admin. Administrator-only settings and RPCs remained unavailable, and a browser with an existing limited credential could not recover administrator access through another fresh host-issued link.

Why This Change Was Made

The host-issued entry points reused the generic bounded control-ui bootstrap profile. The resulting limited scopes were persisted and reused on reconnect and reload. Existing limited browsers also had no narrow host-authorized exception allowing a fresh handoff to upgrade the same signed key.

This change adds a dedicated control-ui-owner profile selected by the bootstrapProfile=owner URL-fragment hint. The Control UI accepts the hint only alongside a bootstrap token, removes both fragment fields immediately, and requests exactly:

  • operator.admin
  • operator.approvals
  • operator.pairing
  • operator.questions
  • operator.read
  • operator.talk.secrets
  • operator.write

The Gateway verifies that exact closed profile before redemption. First redemption binds the handoff to the browser's signed device ID and public key. It supports fresh owner pairing and a same-key upgrade from an existing limited credential, then rotates to a durable device credential and clears the transient handoff state.

The exception remains narrowly bounded:

  • Generic Control UI and Telegram Mini App handoffs retain their bounded profiles.
  • Mobile Full and Limited profiles retain their existing scopes.
  • Ordinary stored and shared credentials cannot silently widen access.
  • Unrelated browser keys cannot inherit or replay the grant.
  • Locality, proxy identity, and manual pairing behavior are unchanged.

The dashboard, onboarding, operator-scope, and Control UI documentation now describes the owner handoff and its boundaries. The dashboard troubleshooting text also correctly documents authentication precedence: a pending bootstrap token is preferred for its handoff; without one, an explicit shared token or password precedes the stored device credential. The changelog records the user-facing fix.

User Impact

A fresh browser opened from openclaw dashboard or graphical onboarding now receives durable administrator access and retains it across reconnects, Gateway restarts, and reloads.

A previously limited browser can recover administrator access by redeeming a fresh host-issued handoff with the same signed key. Other browsers and ordinary authentication paths remain limited or require their existing approval flow.

Evidence

Automated verification:

  • Focused Testbox matrix: 209 tests passed across seven Vitest shards, covering exact profile validation, signed-key binding, fresh pairing, durable reload, same-key recovery, different-key and replay rejection, expiry, issuer-generation checks, generic bounded handoffs, ordinary upgrades, and mobile profiles.
  • pnpm check:changed: passed.
  • pnpm docs:check-mdx: 768 files passed.
  • pnpm docs:check-links: 6,399 links checked, 0 broken.
  • pnpm ui:build: production bundle, precompressed assets, and performance limits passed.

OCM-backed real-browser verification covered:

  • A fresh owner handoff enabling an administrator-only setting, successfully issuing config.patch, surviving the resulting Gateway restart, reconnecting, and retaining the setting and administrator access after reload.
  • A generic bounded credential remaining limited before and after reload.
  • A fresh owner handoff upgrading that same signed limited browser to the exact seven-scope profile and retaining it after reload.
  • A different clean browser replaying the consumed URL and being rejected with bootstrap_token_invalid, without creating a pending approval.

An independent review of the final patch before rebasing found no blocking runtime or security issue. The subsequent conflict-free rebase onto current origin/main mapped all three commits one-to-one with stable patch IDs and no relevant upstream contract changes, so the existing verification remains applicable.

Size:

  • Production: +166 -37 (net +129)
  • Tests: +295 -35 (net +260)
  • Documentation and changelog: +31 -15 (net +16)
  • Total: 26 files, +492 -87

The positive production growth implements a concrete host-authorized security boundary and carries one closed profile from issuance through fragment handling, signed redemption, and the Gateway pairing decision. It adds no configuration surface, protocol-version change, schema migration, persistence path, or fallback authentication path.

@shakkernerd
shakkernerd requested a review from a team as a code owner August 6, 2026 00:26
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime commands Command implementations size: L maintainer Maintainer-authored PR labels Aug 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 5, 2026, 8:37 PM ET / August 6, 2026, 00:37 UTC.

ClawSweeper review

What this changes

The PR changes dashboard and graphical-onboarding Control UI handoffs to issue a signed browser a durable administrator credential through a closed owner bootstrap profile.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 6 items remain

Keep open: the PR addresses a source-proven administrator-access regression, but it also makes a host-only administrator handoff selectable through an existing public plugin SDK issuer. That authorization-boundary decision needs maintainer confirmation and a core-only repair before merge.

Priority: P1
Reviewed head: 87b45b6d7f90315c9fa860867c5e57b888e15502
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source-proven repair is substantial, but the public administrator-handoff contract requires resolution before it is merge-ready.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes real-browser OCM coverage.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes real-browser OCM coverage.
Evidence reviewed 5 items Current-main regression: The dashboard handoff issues the bounded control-ui profile, whose operator scope list omits operator.admin; the current browser client requests that bounded bootstrap scope set.
Regression provenance: Blame attributes the current handoff issuance and bootstrap verification lines to the commit that introduced the current behavior.
Public SDK boundary: The existing public plugin SDK re-exports issueDeviceBootstrapToken and the bootstrap purpose/profile types; accepting control-ui-owner therefore changes what plugin callers can issue.
Findings 2 actionable findings [P1] Keep the owner profile out of the plugin SDK
[P3] Remove the release-owned changelog entry
Security Needs attention Public bootstrap issuer can mint owner handoffs: The accepted-purpose expansion allows plugin callers of the existing public issuer to request an automatic browser administrator handoff rather than only bounded Control UI access.

How this fits together

Dashboard and onboarding create a one-time browser URL, the Control UI redeems it with its signed device identity, and the Gateway turns the approved handoff into a durable device credential. This change affects the authorization boundary between host-issued browser setup, plugin-visible bootstrap issuance, and administrator RPC access.

flowchart LR
  A[Dashboard or onboarding] --> B[One-time owner handoff]
  B --> C[Control UI signed browser]
  C --> D[Gateway profile and key check]
  D --> E{Exact host-authorized profile?}
  E -->|Yes| F[Durable administrator credential]
  E -->|No| G[Rejected or normal pairing]
  H[Plugin bootstrap API] --> B
Loading

Decision needed

Question Recommendation
May the public openclaw/plugin-sdk/device-bootstrap issuer intentionally mint the new control-ui-owner profile, which silently grants a signed browser administrator access? Keep issuance core-only: Reserve the owner purpose for dashboard/onboarding internals and reject it from the public plugin issuer while retaining the closed Gateway profile checks.

Why: The PR changes an existing public bootstrap API from bounded browser handoffs to a new administrator-capable browser path; repository policy requires maintainer-visible direction for plugin API and authorization-boundary changes.

Before merge

  • Keep the owner profile out of the plugin SDK (P1) - issueDeviceBootstrapToken is already publicly exported through openclaw/plugin-sdk/device-bootstrap. Adding control-ui-owner to its accepted purpose set lets a plugin mint the same silently approved administrator browser handoff, with no dashboard/onboarding issuer proof. Keep this purpose core-only or explicitly establish and document that public authority, with an SDK-boundary regression test.
  • Remove the release-owned changelog entry (P3) - This normal PR adds a CHANGELOG.md entry even though repository policy reserves that file for release generation; the PR body already contains the needed release-note context.
  • Resolve security concern: Public bootstrap issuer can mint owner handoffs - The accepted-purpose expansion allows plugin callers of the existing public issuer to request an automatic browser administrator handoff rather than only bounded Control UI access.
  • Resolve merge risk (P1) - A third-party plugin using the existing public bootstrap issuer can request the new owner purpose and obtain the same silent browser-administrator path, contradicting the claimed host-issued boundary unless that authority is deliberately part of the plugin contract.
  • Complete next step (P2) - A maintainer must decide the public plugin authority for the new administrator profile before a safe mechanical repair can be selected.

Findings

  • [P1] Keep the owner profile out of the plugin SDK — src/shared/device-bootstrap-profile.ts:4-8
  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:67
  • [high] Public bootstrap issuer can mint owner handoffs — src/shared/device-bootstrap-profile.ts:4
Agent review details

Security

Needs attention: The diff introduces a new administrator-capable bootstrap purpose through an existing public plugin-facing issuance API without issuer provenance.

PR surface

Source +274, Tests +115, Docs +16. Total +405 across 26 files.

View PR surface stats
Area Files Added Removed Net
Source 12 329 55 +274
Tests 8 131 16 +115
Docs 6 31 15 +16
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 26 491 86 +405

Review metrics

Metric Value Why it matters
Bootstrap profile surface 1 administrator-capable purpose added It changes a public bootstrap profile contract from bounded browser access to a silent administrator handoff.
Production versus tests production +166/-37; tests +295/-35 The stated production growth is tied to a security boundary, so the public issuer boundary needs resolution before that growth is accepted.

Stored data model

Persistent data-model change detected: migration/backfill/repair: CHANGELOG.md, migration/backfill/repair: docs/cli/dashboard.md, migration/backfill/repair: docs/gateway/operator-scopes.md, migration/backfill/repair: src/gateway/server/ws-connection/connect-device-pairing.ts, vector/embedding metadata: src/gateway/server/ws-connection/connect-device-metadata.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Restrict the owner issuer before merge (recommended)
    Make control-ui-owner core-only, add an SDK-boundary regression, and remove the release-owned changelog entry.
  2. Explicitly accept plugin authority
    Approve and document the public plugin contract that permits plugins to silently issue browser administrator handoffs.

Technical review

Best possible solution:

Keep owner-profile issuance core-private to dashboard and onboarding, reject it from the generic plugin bootstrap issuer, and preserve the exact signed-key and closed-scope Gateway checks.

Do we have a high-confidence way to reproduce the issue?

Yes, source-reproducible: current main issues a bounded Control UI bootstrap profile without operator.admin, requests that same scope set in the browser, and does not permit this browser scope upgrade through the host handoff path.

Is this the best way to solve the issue?

No: the closed profile, signed-key binding, and exact Gateway validation are the right repair shape, but making the owner purpose available through the generic public plugin issuer weakens the stated host-only boundary.

Full review comments:

  • [P1] Keep the owner profile out of the plugin SDK — src/shared/device-bootstrap-profile.ts:4-8
    issueDeviceBootstrapToken is already publicly exported through openclaw/plugin-sdk/device-bootstrap. Adding control-ui-owner to its accepted purpose set lets a plugin mint the same silently approved administrator browser handoff, with no dashboard/onboarding issuer proof. Keep this purpose core-only or explicitly establish and document that public authority, with an SDK-boundary regression test.
    Confidence: 0.9
  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:67
    This normal PR adds a CHANGELOG.md entry even though repository policy reserves that file for release generation; the PR body already contains the needed release-note context.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 678a3c18a941.

Labels

Label changes:

  • add P1: The PR repairs an administrator workflow that currently leaves host-side owners unable to manage administrator-only Control UI settings.
  • add merge-risk: 🚨 compatibility: A public plugin SDK bootstrap contract gains a new privilege-bearing purpose with different browser pairing behavior.
  • add merge-risk: 🚨 security-boundary: The new purpose can cause automatic durable administrator authorization, so its issuer boundary must be explicit.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes real-browser OCM coverage.

Label justifications:

  • P1: The PR repairs an administrator workflow that currently leaves host-side owners unable to manage administrator-only Control UI settings.
  • merge-risk: 🚨 security-boundary: The new purpose can cause automatic durable administrator authorization, so its issuer boundary must be explicit.
  • merge-risk: 🚨 compatibility: A public plugin SDK bootstrap contract gains a new privilege-bearing purpose with different browser pairing behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless describes real-browser OCM coverage.

Evidence

Security concerns:

  • [high] Public bootstrap issuer can mint owner handoffs — src/shared/device-bootstrap-profile.ts:4
    The accepted-purpose expansion allows plugin callers of the existing public issuer to request an automatic browser administrator handoff rather than only bounded Control UI access.
    Confidence: 0.9

What I checked:

Likely related people:

  • steipete: Current handoff issuance, profile handling, SDK bootstrap barrel, and related verification lines trace to the commit that introduced this flow. (role: current authorization-flow author; confidence: high; commits: c2215d050404; files: src/commands/control-ui-handoff.ts, src/infra/device-bootstrap.ts, src/plugin-sdk/device-bootstrap.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Make the owner bootstrap profile unavailable to the public plugin issuer and add focused SDK-boundary coverage.
  • Remove the release-owned CHANGELOG.md entry; keep release-note context in the PR body.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@shakkernerd shakkernerd self-assigned this Aug 6, 2026
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Maintainer decision: the public device-bootstrap SDK intentionally permits authorized plugins to issue full-access device handoffs. The existing mobile-full profile already carries operator.admin, which satisfies all operator scopes, so rejecting only control-ui-owner would not reduce plugin authority and would make the issuer contract inconsistent. The changelog entry is retained under the maintainer changelog policy.

@shakkernerd
shakkernerd force-pushed the fix/control-ui-owner-handoff branch from 87b45b6 to 37aa0b9 Compare August 6, 2026 01:22
@shakkernerd
shakkernerd merged commit 37aa0b9 into main Aug 6, 2026
49 checks passed
@shakkernerd
shakkernerd deleted the fix/control-ui-owner-handoff branch August 6, 2026 01:23
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Merged.

What changed after review:

  • Recorded the maintainer decision that the existing plugin SDK full-access provisioning authority is intentional.
  • Preserved the owner-profile, signed-key, replay, sibling-handoff, documentation, and changelog boundaries.
  • Replayed the unchanged patch as a signed linear stack onto current main.

Verification:

  • Fully green checkpoint at 87b45b6d7f90315c9fa860867c5e57b888e15502; exact signed patch replay fast-forwarded to main.
  • Focused Testbox matrix: 209 tests passed across seven Vitest shards.
  • OCM real-browser proof covered fresh owner access, same-key recovery, restart/reload persistence, bounded generic access, and different-key replay rejection.
  • Auto-review: the plugin SDK concern was inspected and rejected with a recorded maintainer rationale; the changelog was retained.
  • GitHub checks: the green checkpoint passed openclaw/ci-gate; range-diff proved the signed replay content-equivalent.

Landed on main:

Thanks @shakkernerd!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 6, 2026
vincentkoc added a commit to VACInc/openclaw that referenced this pull request Aug 6, 2026
…cope

* origin/main: (24 commits)
  fix(backup): skip transient gateway lock databases (openclaw#119782)
  test(agents): use canonical auth session fixtures (openclaw#119821)
  fix(memory): keep QMD file hints after stale docid misses (issue openclaw#113041) (openclaw#113515)
  test(doctor): align fast-path repair contracts (openclaw#119812)
  perf(agents): index subagent recovery ownership (openclaw#119793)
  fix(gateway): keep chat startup off catalog discovery (openclaw#119742)
  fix(test): keep TUI PTY suites in their owner lane (openclaw#119787)
  docs: correct dashboard auth precedence (openclaw#119785)
  docs: document control ui owner handoff
  fix: grant host-authorized control ui owner access
  fix(worktrees): preserve registered roots during orphan cleanup (openclaw#119709)
  fix(matrix): prevent shared client key collisions (openclaw#119667)
  fix(diagnostics-otel): propagate exported span context (openclaw#112283)
  fix(worker): isolate state observer failures (openclaw#117507)
  fix(qa): attest realized profile executions (openclaw#119761)
  fix(gateway): finish successful sessions after timestamp races (openclaw#119752)
  fix(agents): fence restart recovery lifecycle (openclaw#119776)
  fix(ui): preserve chat history and active run timing (openclaw#119729)
  improve(ollama): reduce inactive startup cost (openclaw#119745)
  improve(gateway): defer inactive plugin runtime imports (openclaw#119733)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Host-issued Control UI handoffs leave owners without administrator access

1 participant