fix: gate owner-only HTTP tools#90261
Conversation
|
Codex review: found issues before merge. Reviewed June 4, 2026, 5:54 AM ET / 09:54 UTC. Summary PR surface: Source +17, Tests +116. Total +133 across 4 files. Reproducibility: yes. Source inspection shows current main removes these tools from the default deny when Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the centralized resolver gate, update the public Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main removes these tools from the default deny when Is this the best way to solve the issue? Mostly yes. The shared resolver is the right boundary because both HTTP and RPC invoke paths call Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against f7ef52e66d97. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +17, Tests +116. Total +133 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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 re-review I updated the PR body with real loopback Gateway proof. Summary: a real |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Verification update for current head
Known external gaps:
|
* fix: gate owner-only HTTP tools * fix: inherit HTTP owner tool denies * fix: use mutable HTTP owner deny policy * fix: preserve RPC owner tool access * docs: clarify owner-only gateway tool allowlist --------- Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
* fix: gate owner-only HTTP tools * fix: inherit HTTP owner tool denies * fix: use mutable HTTP owner deny policy * fix: preserve RPC owner tool access * docs: clarify owner-only gateway tool allowlist --------- Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
Summary
What problem does this PR solve?
POST /tools/invokeand the sharedtools.invokepath.gateway.tools.allowas an owner/trusted-operator override for the default HTTP deny list, but prevents non-owner identity-bearing callers from receiving server-credential gateway, cron, or nodes wrappers.operator.adminbehavior unchanged: trusted operator/admin callers can still use explicitly enabled owner-only tools.Why does this matter now?
What is the intended outcome?
What is intentionally out of scope?
What does success look like?
404 not_foundfor owner-only core tools.not_foundfor the same owner-only core tools.What should reviewers focus on?
src/gateway/tool-resolution.tsapplies the owner-only deny after normal policy allow resolution sogateway.tools.allowcannot reopen these wrappers to non-owner callers.src/gateway/server-methods/tools-invoke.tspasses RPC admin scope into the shared invocation path so admin RPC clients remain owner-capable.src/security/dangerous-tools.tskeeps the HTTP default deny and owner-only lists centralized.src/gateway/tools-invoke-http.test.tscovers non-owner denial, admin/shared-secret owner behavior, and spawned-session deny inheritance.AI-assisted: yes.
Linked context
Which issue does this close?
No public issue is linked.
Which issues, PRs, or discussions are related?
Maintainer-requested security hardening for the Gateway tools boundary.
Was this requested by a maintainer or owner?
Yes, requested through the maintainer tracking workflow.
Real behavior proof (required for external PRs)
gateway.tools.allowon Gateway tool invocation surfaces.openclaw gateway runon loopback with a temporaryOPENCLAW_HOMEandOPENCLAW_CONFIG_PATH; channels/providers skipped.OPENCLAW_SKIP_CHANNELS=1 OPENCLAW_SKIP_PROVIDERS=1 pnpm openclaw gateway run --allow-unconfigured --auth none --bind loopback --port 26779, using a temp config withgateway.auth.mode="none",gateway.tools.allow=["gateway","cron","nodes"], and main-agenttools.allow=["gateway","cron","nodes"]; then callPOST /tools/invokewithcurlusingx-openclaw-scopes: operator.writefor each owner-only tool andx-openclaw-scopes: operator.adminfor the owner control.nonowner-gateway http=404 {"ok":false,"errorType":"not_found"},nonowner-cron http=404 {"ok":false,"errorType":"not_found"},nonowner-nodes http=404 {"ok":false,"errorType":"not_found"}, andadmin-gateway http=200 {"ok":true,"resultKeys":["content","details"]}.gateway,cron, andnodesto a write-scoped non-owner caller despite explicit allowlists, while an admin-scope caller still reached the explicitly allowed gateway tool.auth.mode="none"identity-bearing loopback headers rather than an external reverse proxy, matching the documented private-ingress identity-bearing mode.gateway.tools.allowincluded a tool and did not apply any later sender-owner deny for these core wrappers.Tests and validation
Which commands did you run?
node scripts/run-vitest.mjs src/gateway/tools-invoke-http.test.ts src/gateway/tools-invoke-http.cron-regression.test.ts src/gateway/tool-resolution.test.tsnode scripts/run-oxlint-shards.mjs --threads=8git diff --checkWhat regression coverage was added or updated?
cron,gateway, ornodeseven when both agent policy andgateway.tools.allowinclude them.operator.adminRPC callers remain owner-capable.What failed before this fix, if known?
gateway.tools.allowremoved the default deny and no owner-only deny remained.If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes. Non-owner identity-bearing callers now see owner-only core tools as unavailable on Gateway tool invocation surfaces.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)Yes. This restores an auth/tool-exposure boundary for owner-only core wrappers on the Gateway tools surface.
What is the highest-risk area?
The main risk is over-restricting legitimate direct automation that relied on write-scoped identity-bearing callers using
cron,gateway, ornodes.How is that risk mitigated?
The restriction is scoped to non-owner callers only. Admin/owner scope and shared-secret trusted-operator callers keep the existing explicitly enabled behavior, and the regression tests plus real loopback proof cover both sides.
Current review state
What is the next action?
Review the PR and run CI.
What is still waiting on author, maintainer, CI, or external proof?
CI has two failures currently annotated outside this PR's changed files; local focused validation, local oxlint, review-pr, autoreview, and GHSA dry-run are clean at the current head.
Which bot or reviewer comments were addressed?
ClawSweeper requested real behavior proof; the PR body now includes a real loopback gateway curl proof.