Skip to content

fix(gateway): keep local CLI shared auth off device scopes#96002

Merged
steipete merged 2 commits into
mainfrom
fix/gateway-cli-shared-token-scopes
Jul 5, 2026
Merged

fix(gateway): keep local CLI shared auth off device scopes#96002
steipete merged 2 commits into
mainfrom
fix/gateway-cli-shared-token-scopes

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Fixes #95997

What Problem This Solves

Local CLI Gateway calls could poison the durable CLI device scope baseline: a read-scoped gateway health call could leave the CLI paired at operator.read, then a later write-scoped agent call hit scope upgrade pending approval on the primary Gateway path.

Why This Change Was Made

The fix keeps the existing paired-device scope-upgrade protection intact and moves the local CLI shared-token/password path out of durable device identity. That matches the backend local shared-auth carve-out without allowing generic device-less shared-token clients to self-declare scopes.

Concretely:

  • Loopback CLI shared-token/password calls omit durable device identity.
  • The Gateway preserves declared scopes only for local, non-browser CLI shared-token/password auth.
  • Generic device-less shared-token/password clients still have self-declared scopes cleared.
  • Paired devices reconnecting with wider scopes still require explicit approval.

User Impact

Users and release operators can run read-scoped local CLI probes before agent commands without blocking the primary Gateway agent path behind a stale operator.read pairing baseline. Remote/device-token scope upgrades remain explicit.

Evidence

  • node scripts/run-vitest.mjs src/gateway/call.test.ts src/gateway/server/ws-connection/handshake-auth-helpers.test.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/server.silent-scope-upgrade-reconnect.poc.test.ts
    • 12 files passed, 632 tests passed.
  • node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox -- env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed
    • provider blacksmith-testbox, id tbx_01kvskg4kfk1p575p8shahtxmv, run https://github.com/openclaw/openclaw/actions/runs/28007575695, exit 0.
  • .agents/skills/autoreview/scripts/autoreview --mode local --base origin/main
    • clean, no accepted/actionable findings.

@vincentkoc vincentkoc self-assigned this Jun 23, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Jun 23, 2026
@clawsweeper

clawsweeper Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 5, 2026, 9:48 AM ET / 13:48 UTC.

Summary
The branch changes loopback Gateway CLI token/password calls to omit durable device identity, adds server-side local CLI shared-auth scope preservation, updates Gateway auth regression tests, and edits the changelog.

PR surface: Source +35, Tests +141, Docs +1. Total +177 across 8 files.

Reproducibility: yes. at source level. Explicit URL/password and trusted-proxy fallback password calls can send a password while the omission predicate sees a non-password auth mode, and direct_local scope preservation follows loopback socket classification without Host proof.

Review metrics: 1 noteworthy metric.

  • Gateway auth exceptions: 1 client omission predicate changed, 1 server scope-preservation exception added. Both exceptions decide whether token/password Gateway clients use durable device identity or keep self-declared operator scopes before merge.

Stored data model
Persistent data-model change detected: serialized state: src/gateway/server.auth.compat-baseline.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #95997
Summary: This PR is the candidate fix for the canonical local CLI shared-auth stale device-scope issue; related reports touch the same Gateway pairing area but do not supersede it.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦞 diamond lobster
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Bind CLI scope preservation to proven local/private Host contexts and add a public-Host-over-loopback regression.
  • Derive device-identity omission from the resolved credential type actually sent, including explicit password and trusted-proxy password fallback.
  • Rerun the focused Gateway auth suites plus live token and password CLI health-to-admin sequences.

Risk before merge

  • [P1] Merging the current head could let a CLI-shaped shared-token/password WebSocket that reaches the Gateway over a loopback reverse-proxy hop keep self-declared admin scopes without device identity.
  • [P2] Password-auth local CLI users can still hit the stale read-scoped durable device baseline because explicit URL/password and trusted-proxy local password fallback are not treated as active shared auth by the client omission predicate.

Maintainer options:

  1. Tighten Local CLI Auth Before Merge (recommended)
    Require Host-local/private proof for CLI scope preservation and derive client omission from the resolved credential type before landing.
  2. Accept The Broader Local Trust Model
    Maintainers may intentionally allow socket-local CLI-shaped shared-secret clients to keep declared scopes, but should document and own that auth-boundary change.
  3. Pause Until Gateway Auth Ownership Decides
    Keep the PR open without merge until the Gateway auth owner chooses the permanent reverse-proxy/locality rule.

Next step before merge

  • [P2] Gateway auth/security-boundary findings remain on a protected maintainer PR, so the next action is owner repair or an explicit boundary decision before merge.

Maintainer decision needed

  • Question: Should device-less CLI shared-auth scope preservation require private/loopback Host proof, or may any loopback-socket direct_local CLI-shaped shared-secret client keep self-declared scopes?
  • Rationale: The PR changes an authorization boundary, and accepting socket-only locality would intentionally trust reverse-proxy loopback hops differently from the existing Host-checked container-local path.
  • Likely owner: steipete — They authored the latest repair commit and posted the current security-boundary proof/commentary on this PR.
  • Options:
    • Tighten before merge (recommended): Require local/private Host proof for CLI scope preservation and make client identity omission follow the resolved token/password credential kind.
    • Accept socket-local trust: Allow loopback-socket CLI-shaped shared-secret clients to keep declared scopes, but document and own the broader Gateway auth boundary.
    • Pause for Gateway auth owner: Leave the PR open until the Gateway auth owner chooses the permanent local-client contract.

Security
Needs attention: The diff changes Gateway auth scope preservation and still has a concrete device-less direct_local scope bypass risk.

Review findings

  • [P1] Require Host-local proof before preserving CLI scopes — src/gateway/server/ws-connection/handshake-auth-helpers.ts:299-301
  • [P2] Treat the sent password as active shared auth — src/gateway/call.ts:496-498
Review details

Best possible solution:

Keep the fix in the Gateway client/server auth boundary, but derive device-identity omission from the credential actually sent and preserve CLI scopes only for shared-secret requests with local/private Host proof plus regressions for password fallback and public-Host loopback.

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

Yes at source level. Explicit URL/password and trusted-proxy fallback password calls can send a password while the omission predicate sees a non-password auth mode, and direct_local scope preservation follows loopback socket classification without Host proof.

Is this the best way to solve the issue?

No. The Gateway client/server auth boundary is the right layer, but the current predicates are not the narrowest maintainable fix until credential-kind and locality proof are tightened.

Full review comments:

  • [P1] Require Host-local proof before preserving CLI scopes — src/gateway/server/ws-connection/handshake-auth-helpers.ts:299-301
    This repeats the prior blocker: direct_local is still enough to preserve CLI shared-auth scopes, but that locality is based on the loopback socket before the Host-checked cli_container_local path runs. A reverse proxy that connects over loopback without forwarded headers can present a public Host and still let a CLI-shaped shared-secret client keep self-declared admin scopes without device identity.
    Confidence: 0.88
  • [P2] Treat the sent password as active shared auth — src/gateway/call.ts:496-498
    This repeats the prior blocker: explicit URL+password can skip config loading, and trusted-proxy mode can resolve a local password fallback, so the client can send a password while authMode is not password. The predicate then keeps durable device identity attached and password-auth CLI calls can still hit the stale read-scoped pairing baseline.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P1: The PR targets a Gateway auth bug that can block local CLI agent workflows and currently changes operator scope authorization.
  • merge-risk: 🚨 auth-provider: The client-side predicate decides whether token/password Gateway calls attach durable device identity and currently misses supported password credential paths.
  • merge-risk: 🚨 security-boundary: The server-side exception can preserve self-declared admin scopes for CLI-shaped shared-secret connections classified as direct_local by socket address alone.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The external-contributor proof gate does not apply to this member-authored maintainer-labeled PR; the posted Testbox/live token-auth proof is useful but does not cover the current password and Host-locality blockers.
Evidence reviewed

PR surface:

Source +35, Tests +141, Docs +1. Total +177 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 58 23 +35
Tests 4 142 1 +141
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 201 24 +177

Security concerns:

  • [high] Direct-local CLI scope preservation is too broad — src/gateway/server/ws-connection/handshake-auth-helpers.ts:299
    The server can preserve self-declared admin scopes for CLI-shaped shared-secret connections classified as direct_local, while direct_local is based on loopback socket address without Host-local proof.
    Confidence: 0.88

What I checked:

  • PR head and live discussion inspected: Live PR metadata shows head e9509ee, the maintainer label, the linked closing issue, and prior review comments for the same auth-boundary blockers. (e9509eec96a5)
  • Client omission predicate still keys password to auth mode: At PR head, device identity is omitted only when authMode is password and a password is present; explicit URL/password and trusted-proxy fallback can send a password while authMode is token or trusted-proxy. (src/gateway/call.ts:496, e9509eec96a5)
  • Explicit URL/password can bypass config loading: The explicit connection policy allows config loading to be skipped when URL and concrete token/password auth are supplied, leaving resolveGatewayCallAuth to see the empty default config. (src/gateway/explicit-connection-policy.ts:14, e9509eec96a5)
  • Trusted-proxy local password fallback is a real credential path: Credential resolution returns explicit or environment password credentials when gateway.auth.mode is none or trusted-proxy, so the omission predicate must handle a sent password outside authMode=password. (src/gateway/auth-surface-resolution.ts:211, e9509eec96a5)
  • Server CLI scope preservation still accepts direct_local: The new helper preserves CLI shared-auth scopes for direct_local, while direct_local is returned before the stricter private/loopback Host checks used by cli_container_local and shared_secret_loopback_local. (src/gateway/server/ws-connection/handshake-auth-helpers.ts:299, e9509eec96a5)
  • direct_local remains socket-only: isLocalDirectRequest returns true for a loopback socket without forwarded headers and does not verify that the Host header is private or loopback. (src/gateway/auth.ts:173, e9509eec96a5)

Likely related people:

  • steipete: They authored the latest PR-head commit and previously carried the gateway client extraction that moved client persistence/auth boundaries around this path. (role: recent gateway auth reviewer and adjacent contributor; confidence: high; commits: e9509eec96a5, b1117d98622f; files: src/gateway/call.ts, packages/gateway-client/src/client.ts)
  • vincentkoc: They authored this PR's original commit and have prior Gateway credential SecretInput runtime work in the same client credential-resolution surface. (role: recent area contributor and PR/issue owner; confidence: high; commits: 95917acb2a59, 935bd6de7fcb; files: src/gateway/call.ts, src/gateway/auth-surface-resolution.ts)
  • Devin Robison: The linked bug and this PR must preserve the paired-device scope-upgrade protection introduced in their Gateway reconnect hardening commit. (role: scope-upgrade guard introducer; confidence: medium; commits: 81ebc7e0344f; files: src/gateway/server/ws-connection/message-handler.ts, src/gateway/server.silent-scope-upgrade-reconnect.poc.test.ts)
  • jacobtomlinson: Their backend scope-upgrade enforcement commit is part of the Gateway pairing path this PR changes around device-less shared auth. (role: adjacent backend scope-upgrade contributor; confidence: medium; commits: d3d8e316bd81; files: src/gateway/server/ws-connection/message-handler.ts, src/gateway/server/ws-connection/handshake-auth-helpers.ts)
  • sar618: Their prior work changed authenticated CLI connection pairing behavior in Docker, which is directly adjacent to the CLI local/shared-auth locality decision here. (role: adjacent Docker CLI locality contributor; confidence: medium; commits: 224fceee1a74; files: src/gateway/server/ws-connection/handshake-auth-helpers.ts, src/gateway/server/ws-connection/message-handler.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (5 earlier review cycles)
  • reviewed 2026-06-30T07:32:07.968Z sha 40a4228 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T11:54:19.205Z sha ef1a26e :: needs changes before merge. :: [P2] Honor explicit password auth when omitting device identity
  • reviewed 2026-07-05T13:15:21.858Z sha 55503a7 :: found issues before merge. :: [P1] Require host-local CLI scope preservation | [P2] Treat resolved password credentials as active shared auth
  • reviewed 2026-07-05T13:21:16.560Z sha 19ad626 :: found issues before merge. :: [P1] Require Host-local CLI scope preservation | [P2] Treat resolved password credentials as active shared auth
  • reviewed 2026-07-05T13:42:55.764Z sha 531725e :: found issues before merge. :: [P1] Require Host-local proof before preserving CLI scopes | [P2] Treat the sent password as active shared auth

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 23, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 27, 2026
@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch from 40a4228 to ef1a26e Compare July 5, 2026 11:22
@steipete
steipete marked this pull request as ready for review July 5, 2026 11:22
@steipete
steipete requested a review from a team as a code owner July 5, 2026 11:22
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Replayed and tightened on current main at ef1a26e63db762839039112a228413be28107d3a.

Review found and fixed one regression in the submitted patch: inactive ambient credentials under gateway.auth.mode: none could incorrectly make a CLI connection device-less. The omission predicate now requires the credential type to match the effective auth mode, with a focused regression test.

Security boundary checked end to end:

  • direct-local CLI token/password auth can use the method's requested scopes without durable device pairing;
  • paired read-scoped devices still cannot silently widen to admin;
  • auth-none, remote, browser-origin, device-token, and non-CLI paths retain their prior identity/scope checks.

Proof on Blacksmith Testbox tbx_01kwrxnvc23x3cy9p6peetbh6m:

  • pnpm test src/gateway/call.test.ts src/gateway/server/ws-connection/handshake-auth-helpers.test.ts src/gateway/server.auth.compat-baseline.test.ts src/gateway/server.silent-scope-upgrade-reconnect.poc.test.ts — 648/648 passed.
  • pnpm build — passed.
  • isolated live token-auth Gateway: CLI health, then admin set-heartbeats using the same token — both passed.
  • targeted oxfmt and git diff --check — passed.
  • fresh Codex autoreview after the correction — clean.

Review artifacts validate with zero findings. Exact-head hosted CI is the remaining merge gate; I will merge only after it is green.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef1a26e63d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/call.ts
Comment on lines +496 to +498
const hasSharedSecretAuth =
(params.authMode === "token" && Boolean(params.token)) ||
(params.authMode === "password" && Boolean(params.password));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Honor explicit password auth when omitting device identity

When a caller supplies an explicit loopback url plus password, resolveGatewayCallContext takes the config-bypass path and context.config is {}, so authMode resolves to the default token. This check then treats the supplied password as inactive shared auth, keeps the durable device identity attached, and password-protected local CLI/backend calls can still create or hit a stale paired-device scope baseline—the token path is fixed, but the documented password path is not.

Useful? React with 👍 / 👎.

@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. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 5, 2026
@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch from ef1a26e to 69bbf94 Compare July 5, 2026 12:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69bbf942ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +299 to +301
const isLocal = params.locality === "direct_local" || params.locality === "cli_container_local";
const usesSharedSecretAuth = params.authMethod === "token" || params.authMethod === "password";
return isLocal && !params.hasBrowserOriginHeader && params.sharedAuthOk && usesSharedSecretAuth;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Badge Restrict CLI scope preservation to local Host requests

When a gateway is reached through a reverse proxy that connects to it over loopback but does not set forwarded headers, isLocalDirectRequest classifies the socket as direct_local even if the Host header is public/non-local (the handler only logs that case). This new direct_local allowance then lets any client claiming cli with a valid shared token/password keep self-declared operator.admin scopes without a device, so remote proxied CLI-shaped requests can bypass the stale-device scope baseline that non-local shared-auth clients were previously denied.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch from 69bbf94 to b1c03dd Compare July 5, 2026 12:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1c03dd8a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/call.ts
Comment on lines +497 to +498
(params.authMode === "token" && Boolean(params.token)) ||
(params.authMode === "password" && Boolean(params.password));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Include trusted-proxy fallback passwords in CLI identity omission

In a local Gateway configured with gateway.auth.mode: "trusted-proxy" plus the supported local password fallback, callGateway resolves and sends the password, and the server authorizes the loopback request as authMethod: "password". Because this predicate only treats authMode === "password" as active shared-secret auth, those local CLI password calls still attach the durable device identity and can hit the stale read-scoped pairing baseline that this change is meant to bypass for password-auth CLI calls. This is separate from the explicit URL-override password case; the trusted-proxy local password fallback is covered by existing credential/auth tests and needs to be included here or derived from the resolved credential path.

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch from b1c03dd to 9c31064 Compare July 5, 2026 12:43
@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch from 9c31064 to 55503a7 Compare July 5, 2026 12:57
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 5, 2026
@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch 3 times, most recently from 8a208b5 to 531725e Compare July 5, 2026 13:37
@steipete
steipete force-pushed the fix/gateway-cli-shared-token-scopes branch from 531725e to e9509ee Compare July 5, 2026 13:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9509eec96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gateway/call.ts
Comment on lines +496 to +498
const hasSharedSecretAuth =
(params.authMode === "token" && Boolean(params.token)) ||
(params.authMode === "password" && Boolean(params.password));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Accept trusted-proxy password fallback for backend auth

When gateway.auth.mode is trusted-proxy with the supported local password fallback, resolveGatewayCredentials still supplies password and the server authorizes clean loopback fallback as authMethod: "password", but this predicate leaves hasSharedSecretAuth false because authMode is not "password". Fresh evidence beyond the earlier CLI fallback issue is that backend callers with requireLocalBackendSharedAuth then hit the guard below and throw before opening the websocket, breaking node pairing/list paths that intentionally use local backend shared auth under trusted-proxy deployments.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 16865d5 into main Jul 5, 2026
100 of 101 checks passed
@steipete
steipete deleted the fix/gateway-cli-shared-token-scopes branch July 5, 2026 13:52
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 6, 2026
…96002)

* fix(gateway): keep local CLI shared auth off device scopes

* fix(gateway): preserve auth-none CLI device identity

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M 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.

CLI gateway calls can poison local device scopes after read probes

2 participants