Skip to content

fix(mcp): require owner for Claude permission replies - #136924

Merged
RomneyDa merged 1 commit into
extended-stable/2026.6.33from
fix/extended-stable-mcp-owner-permission
Sep 7, 2026
Merged

RomneyDa merged 1 commit into
extended-stable/2026.6.33from
fix/extended-stable-mcp-owner-permission

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Backports b885c81479d (fix(mcp): require owner for Claude permission replies (#98256)) to the frozen extended-stable candidate.

The exact frozen MCP lane showed the candidate consumes a matching yes abcde from any user as an MCP permission response. A non-admin Gateway client can therefore resolve an outstanding Claude permission. This backport carries the authenticated senderIsOwner fact from ingress through the persisted user turn and session broadcast, then makes the MCP bridge resolve only an owner user reply. Non-owner or unproven replies remain ordinary channel messages.

Evidence

  • Reproduction: Plugin Prerelease exact-frozen run 33709410737, MCP channels job 100506487790; expected non-owner channel-forwarding timed out because the candidate consumed it as a permission response.
  • Root cause: frozen src/mcp/channel-bridge.ts handles permissionMatch before queue/Claude channel delivery, without a role/owner predicate.
  • Upstream security fix b885c81479d is absent from frozen candidate 659df810 and is the canonical owner-boundary repair.
  • Adaptation: two merge conflicts in session event metadata were resolved by preserving candidate behavior and forwarding only senderIsOwner; the unrelated upstream idempotency-key assertion was not added because the candidate lacks that precondition.

Validation

  • node scripts/run-vitest.mjs run src/mcp/channel-bridge.test.ts src/mcp/channel-server.test.ts src/gateway/server-session-events.test.ts src/sessions/user-turn-transcript.test.ts — 60 passed.
  • node scripts/run-vitest.mjs run src/gateway/server-methods/chat.directive-tags.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts — 343 passed.
  • git diff --check; formatting; autoreview passed.
  • Current gate: this head\x27s preflight/security-fast run predates the frozen-checkout authentication repair fix(ci): authenticate frozen source checkouts #136949 and fails before validation. Rerun after fix(ci): authenticate frozen source checkouts #136949 lands.

Scope

Production +52 / -9; tests +148 / -3; docs +1 / -1. This is a source-compatible security/lifecycle backport. No config schema, package, tag, npm, or candidate ref mutation is included.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa

RomneyDa commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Canonical security backport b885c81479d, adapted only at the frozen session-event metadata boundary. Exact frozen Docker reproduction: run 33709410737 / job 100506487790. Focused MCP, Gateway, session, and transcript tests pass.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts docker Docker and sandbox tooling labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 7, 2026, 3:56 PM ET / 19:56 UTC.

ClawSweeper review

What this changes

The PR carries authenticated sender ownership through transcript events so only owner user replies can resolve Claude permission requests.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this remains a useful extended-stable security backport, despite the original fix already shipping on main. No introduced correctness defect was found; frozen-build validation and release acceptance remain outstanding.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported security backport with useful regression coverage and no actionable patch finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored backport is exempt from ordinary contributor proof. The original fix reports real non-admin rejection and owner approval through Gateway and stdio MCP; frozen-build qualification remains a release-specific validation requirement, not a newly established authority violation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored backport is exempt from ordinary contributor proof. The original fix reports real non-admin rejection and owner approval through Gateway and stdio MCP; frozen-build qualification remains a release-specific validation requirement, not a newly established authority violation.
Evidence reviewed 8 items Backport remains necessary: The pinned extended-stable base matches permission text without checking role or ownership. The reviewed head adds both predicates before sending the permission notification.
Ingress and final permission boundary: Gateway chat derives ownership from operator.admin; channel replies use the existing command authorization decision. The bridge requires role=user and senderIsOwner=true before its final MCP permission notification. Nonqualifying replies continue through ordinary event delivery.
Persistence and replay boundary: Ownership is added to persisted user-turn metadata and retained across replacement hooks. Session broadcasts extract it before display projection. The transcript publisher normally emits only newly appended messages; MCP history reads do not themselves resolve pending permissions.
Findings None None.
Security None None.

How this fits together

OpenClaw’s MCP bridge connects Gateway conversations to an external Claude session. It converts qualifying chat replies into permission decisions while forwarding other user messages as ordinary conversation events.

flowchart LR
  A[Channel or Gateway message] --> B[Authenticated ownership decision]
  B --> C[User transcript and live event]
  D[Pending Claude permission] --> E[Owner and request check]
  C --> E
  E -->|Owner reply matches| F[Claude permission notification]
  E -->|Otherwise| G[Ordinary conversation event]
Loading

Decision needed

Question Recommendation
Should extended-stable include this owner-only permission backport, accepting that integrations without ownership metadata can no longer approve by text? Include after frozen validation: Accept the stricter boundary once the adapted packaged build demonstrates owner approval, non-owner rejection, and preservation of ordinary messages.

Why: The security direction is already established upstream, but acceptance of the frozen release’s compatibility change remains a release-owner decision.

Before merge

  • Resolve merge risk (P1) - Extended-stable integrations whose live transcript events lack ownership metadata will stop resolving permissions through text replies; the request remains pending while the reply is forwarded as an ordinary message.
  • Resolve merge risk (P1) - The frozen transcript adaptation has focused test coverage, but the captured evidence does not establish after-fix packaged behavior or upgrade compatibility on this release candidate.
  • Complete next step (P1) - Provide the adapted frozen-build MCP result showing non-owner rejection and owner approval, and record release-owner acceptance of the intentional missing-metadata fail-closed behavior.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +31, Tests +102, Docs 0, Other +48. Total +181 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 7 40 9 +31
Tests 6 105 3 +102
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 49 1 +48
Total 16 195 14 +181

Review metrics

Metric Value Why it matters
Ownership metadata contract 1 persisted boolean added; 1 optional live-event field added The permission decision now depends on this metadata surviving the frozen transcript and broadcast path.

Root-cause cluster

Relationship: same_root_cause
Canonical: #98256
Summary: The original merged fix owns the upstream repair; this PR applies that repair to a separate release branch.

Members:

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

Merge-risk options

Maintainer options:

  1. Qualify the frozen ownership path (recommended)
    Validate the packaged backport and record acceptance that missing ownership metadata leaves approvals pending.
  2. Hold the backport
    Pause release inclusion if an existing integration cannot supply trusted ownership metadata.

Technical review

Best possible solution:

Retain the canonical owner-only boundary and qualify the adapted frozen build, with explicit release acceptance of replies lacking ownership metadata remaining unable to approve.

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

Yes, for the extended-stable base: a matching non-admin user reply reaches permission resolution without an owner predicate. Current main and v2026.9.2 already contain the guard; no runtime reproduction was executed in this review.

Is this the best way to solve the issue?

Yes, this is the appropriate bounded backport: reuse ingress authorization and enforce it at the permission notification boundary. A separate allowlist or permissive compatibility mode would duplicate policy or preserve the bypass.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against c688a95c34f1.

Labels

Label justifications:

  • P1: The extended-stable base allows a non-owner message to resolve a privileged Claude permission request.
  • merge-risk: 🚨 compatibility: Existing integrations without authenticated ownership metadata will lose text-based permission resolution after this backport.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored backport is exempt from ordinary contributor proof. The original fix reports real non-admin rejection and owner approval through Gateway and stdio MCP; frozen-build qualification remains a release-specific validation requirement, not a newly established authority violation.

Evidence

What I checked:

Likely related people:

  • eleqtrizit: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RomneyDa: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Attach the adapted frozen-build result and record release acceptance of the missing-metadata behavior.

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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-03T03:17:42.189Z sha e14596d :: blocked before merge. :: none
  • reviewed 2026-09-03T03:25:24.311Z sha e14596d :: blocked before merge. :: none
  • reviewed 2026-09-03T04:11:49.170Z sha e14596d :: blocked before merge. :: none
  • reviewed 2026-09-03T23:52:52.762Z sha e14596d :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Sep 3, 2026
@RomneyDa

RomneyDa commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review exact current head; please confirm only current actionable findings and rank-up moves.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 3, 2026
* fix(mcp): require owner for Claude permission replies

* fix(mcp): prove owner-gated permission replies

(cherry picked from commit b885c81)
@RomneyDa
RomneyDa force-pushed the fix/extended-stable-mcp-owner-permission branch from e14596d to e3e42a6 Compare September 7, 2026 19:48
@RomneyDa
RomneyDa merged commit f3550bd into extended-stable/2026.6.33 Sep 7, 2026
94 checks passed
@RomneyDa
RomneyDa deleted the fix/extended-stable-mcp-owner-permission branch September 7, 2026 20:19
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 docker Docker and sandbox tooling 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. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants