Skip to content

fix(gateway): check browser Origin on Control-UI plugin cookie auth - #119446

Closed
miorbnli wants to merge 1 commit into
openclaw:mainfrom
miorbnli:fix/control-ui-cookie-origin-check
Closed

miorbnli wants to merge 1 commit into
openclaw:mainfrom
miorbnli:fix/control-ui-cookie-origin-check

Conversation

@miorbnli

@miorbnli miorbnli commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #116241

What Problem This Solves

Fixes the primary CSRF vector: a cross-site HTTPS page with a concrete Origin (e.g. https://attacker.example) could present a victim's SameSite=None plugin cookie and the gateway would authorize without checking Origin.

Why This Change Was Made

The cookie path skipped Origin validation entirely. The bearer path's checkBrowserOrigin rejects Origin: null, which the default plugin-tab sandbox (sandbox="allow-scripts" without allow-same-origin, confirmed at ui/src/lib/chat/tool-display.ts:248) emits. This PR adds a gate that rejects concrete cross-site Origins while accepting Origin: null to preserve the sandbox iframe.

Requires maintainer decision: Origin: null is not an identity — an attacker can also create an opaque sandbox. A capability-bound frame authorization mechanism is needed to distinguish the intended plugin tab from attacker-controlled opaque contexts. This is a security/product design decision for @openclaw/openclaw-secops. This PR closes the concrete cross-site Origin vector (the primary reported attack path) but does not close the opaque-origin variant.

User Impact

Cross-site pages with a concrete Origin can no longer use a victim's plugin-tab cookie. The sandboxed plugin-tab iframe continues to work. Non-browser clients are unaffected.

Evidence

  • Base: 5a826aa18d3 | Head: a5dfaa3fb79
  • Environment: Linux 4.19.112-2.el8.x86_64, Node v26.5.0

Real gateway auth before/after proof

A real signed Control-UI plugin cookie was minted via the production setControlUiPluginAuthCookie, then authorizeControlUiPluginCookieRequest was called with different Origin/Sec-Fetch-Site combinations:

=== Control-UI plugin cookie Origin gate (#119446) ===

=== BEFORE (current main: NO Origin check) ===
All scenarios with a valid cookie → AUTHORIZED (blind CSRF for any Origin)

=== AFTER (this PR: concrete cross-site Origin blocked) ===
  Cross-site Origin (attacker)               → BLOCKED    (OK)
  Null Origin + same-origin (sandbox)        → AUTHORIZED (OK)
  Null Origin + cross-site (sandbox)         → AUTHORIZED (OK)
  No Origin (non-browser)                    → AUTHORIZED (OK)
  Same-host loopback Origin                  → AUTHORIZED (OK)

=== Summary ===
Before (current main): cross-site Origin + valid cookie → AUTHORIZED (blind CSRF)
After (this PR):      cross-site Origin + valid cookie → BLOCKED
Sandbox iframe (null Origin): still AUTHORIZED (compatibility preserved)
Non-browser (no Origin): still AUTHORIZED

Before: on current main, a valid cookie + Origin: https://attacker.example.test authorizes the request (blind CSRF). All Origins pass because there is no Origin check.

After: concrete cross-site Origins are blocked. The default sandbox iframe (Origin: null) continues to work. Non-browser clients (no Origin) pass through.

Focused tests (re-run after rebase onto main 5a826aa18d3)

  • node scripts/run-vitest.mjs src/gateway/server.plugin-frame-auth.test.ts -> 17 tests passed
  • node_modules/.bin/oxlint -> 0 warnings, 0 errors

Test coverage

Cross-site concrete Origin → 401; null Origin + same-origin → 200; null Origin + cross-site → 200 (sandbox default); null Origin + no Fetch Metadata → 200; no Origin → 200.

Sandbox embed mode

Default sandbox mode confirmed from source: resolveEmbedSandbox (ui/src/lib/chat/tool-display.ts:248) returns "allow-scripts" for the default case → opaque origin → Origin: null.

Not tested / known limitation

Full browser-to-gateway round trip with a real sandboxed iframe. The null-Origin path accepts opaque sandbox requests that an attacker could also create. A capability-bound frame authorization mechanism is needed for complete protection — requires maintainer decision on #116241.

Rebased onto current main (26505c528b5, head a5dfaa3fb79): clean rebase, no semantic conflicts. The prior CI red shards (copilot registry.contract.test.ts, bash-executor fault-small, image-tool compression policy) ran against a merge tree that is now 1,400+ commits behind current main; focused suite re-verified on the new head: server.plugin-frame-auth.test.ts 17/17, pnpm tsgo exit 0, line-cap and assertion-safety ratchets OK.

Maintainer security disposition (2026-10-31)

Closing this partial implementation under the scoped contributor-PR review; the underlying issue #116241 remains open.

Current main 10f6426f1ecbe389b7fcba70c790bf53e064becd still admits cookie-authenticated plugin reads without an Origin check. A temporary regression through the real Gateway HTTP dispatcher reproduced a concrete attacker Origin returning 200 instead of 401 (9 existing tests passed; diagnostic failed as intended, 51.74 seconds). No browser-readable disclosure was tested.

The default opaque-frame contract was deliberately introduced by #107323, commit efa8075c6831faf8400e6bc40c4f52f401d449d2. It remains in the cookie owner and default sandbox policy. Strictly applying the existing resolveAcceptedBrowserOrigin owner would reject supported opaque-frame requests carrying Origin: null. Allowing null retains the indistinguishable attacker-controlled sandbox request. Sec-Fetch-Site: cross-site does not establish frame identity.

Source-derived matrix, assuming an otherwise valid cookie and authorized GET/HEAD route:

Request Current main This PR Strict supplied-Origin gate
Allowed concrete Origin Accept Accept Accept via existing owner
Mismatching concrete Origin Accept Reject Reject
Origin: null, Sec-Fetch-Site: cross-site Accept Accept; residual attack Reject; breaks supported opaque reads
No Origin, no Fetch Metadata (non-browser) Accept Accept Accept, matching existing no-Origin policy
No Origin, Sec-Fetch-Site: cross-site Accept Accept; residual attack Accept under that same exception

A compatible complete defense needs authorization that distinguishes the intended frame from other opaque contexts. That exceeds this small Origin-gate takeover. The concrete-Origin regression and reuse of the existing origin owner remain useful for that work. No replacement or production change was published; contributor code was read through GitHub only and was not executed.

Independent security review confirmed this conflict. Requested autoreview (Codex, P0-P2) completed on the diagnostic change plus the unchanged auth/origin/cookie/sandbox owners: no actionable findings in that selected scope; it explicitly confirmed that this is a failing diagnostic, not a production fix.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Aug 5, 2026
@miorbnli
miorbnli marked this pull request as ready for review August 5, 2026 03:07
@miorbnli
miorbnli requested a review from a team as a code owner August 5, 2026 03:07
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 28, 2026, 10:13 PM ET / September 29, 2026, 02:13 UTC (Revision 10).

ClawSweeper review

What this changes

The branch adds a browser-Origin check to Control UI plugin-cookie authentication and route tests for cross-site, opaque, and absent Origins.

Merge readiness

⛔ Blocked before merge - 9 items remain

Current main still lacks the cookie-path Origin check, so this PR addresses a real gap. The proposed gate blocks concrete cross-site Origins, but a prior locality defect remains and the security boundary for opaque or absent Origins needs an explicit decision.

Priority: P2
Reviewed head: 4fd398b19f584589633bedf2d3bc05329191ca96
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The targeted change and authorization trace are useful, but a locality defect and missing final-effect security proof limit merge confidence.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Linux terminal trace mints a production cookie and compares authorization results, but does not show the HTTP plugin handler's final effect for an intended frame, a forbidden concrete Origin, or an invalidated cookie. Redacted browser/network logs or terminal traces showing those effects would address the gap; the opaque-origin contract also needs a security decision. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Linux terminal trace mints a production cookie and compares authorization results, but does not show the HTTP plugin handler's final effect for an intended frame, a forbidden concrete Origin, or an invalidated cookie. Redacted browser/network logs or terminal traces showing those effects would address the gap; the opaque-origin contract also needs a security decision. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Pinned introduced change: The PR adds a cookie-specific Origin gate and calls it after validating cookie grants.
Current main remains affected: The fetched current-main cookie authorization path validates grants and profile authority without checking browser Origin.
Locality finding remains: The new call omits isLocalClient. The shared validator accepts a matching loopback Host when that value is undefined, while its tests explicitly reject that match for a non-local client.
Findings 1 actionable finding [P2] Pass verified request locality to the Origin check
Security Needs attention Opaque-origin cookie requests remain authorized: The new gate accepts Origin: null, which the intended sandbox and an attacker-controlled opaque sandbox can both produce. A security owner must choose and verify the intended frame-authority boundary.
Loopback trust lacks verified client locality: The shared validator receives no direct-client signal, so its loopback same-host rule can authorize requests it would reject with isLocalClient: false.

How this fits together

The Gateway issues signed cookies so sandboxed Control UI plugin tabs can request protected plugin routes. HTTP authentication checks each request before the Gateway dispatches it to a plugin handler.

flowchart LR
  A[Plugin tab or other browser] --> B[HTTP request with cookie]
  B --> C[Gateway cookie validation]
  C --> D[Browser Origin gate]
  D --> E[Plugin route authorization]
  E --> F[Plugin handler]
Loading

Decision needed

Question Recommendation
May this PR ship as partial protection while opaque and Origin-less plugin-cookie requests remain authorized? Complete frame binding: Require a capability tied to the intended plugin frame before cookie authority reaches its handler.

Why: Rejecting those requests can break the default sandbox, while accepting them leaves a known browser route around the proposed Origin check; the contributor cannot choose that boundary for maintainers.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Linux terminal trace mints a production cookie and compares authorization results, but does not show the HTTP plugin handler's final effect for an intended frame, a forbidden concrete Origin, or an invalidated cookie. Redacted browser/network logs or terminal traces showing those effects would address the gap; the opaque-origin contract also needs a security decision. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Pass verified request locality to the Origin check (P2) - The new call omits isLocalClient. With an undefined value, the shared validator accepts a matching loopback Host even for a non-local request; its existing tests require rejection when locality is false. Pass isLocalDirectRequest(req) and cover direct, forwarded, and non-local cases.
  • Resolve security concern: Opaque-origin cookie requests remain authorized - The new gate accepts Origin: null, which the intended sandbox and an attacker-controlled opaque sandbox can both produce. A security owner must choose and verify the intended frame-authority boundary.
  • Resolve security concern: Loopback trust lacks verified client locality - The shared validator receives no direct-client signal, so its loopback same-host rule can authorize requests it would reject with isLocalClient: false.
  • Resolve merge risk (P1) - Opaque-origin and Origin-less cookie requests remain authorized; the security owner must decide whether partial CSRF hardening is acceptable while a frame-bound mechanism is developed.
  • Resolve merge risk (P1) - Existing plugin-cookie requests from concrete Origins that are neither trusted nor allowlisted will stop authorizing. Fresh and existing setup behavior needs boundary proof before merge.
  • Resolve merge risk (P1) - The submitted trace stops at cookie authorization, leaving the allowed and forbidden plugin-handler effects and cookie-generation invalidation unproved.
  • Complete next step (P2) - Repair the locality argument, provide redacted handler-effect and cookie-invalidation proof, and obtain current-head security approval for the opaque-origin contract. Updating the PR body should trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P2] Pass verified request locality to the Origin check — src/gateway/control-ui-plugin-origin-gate.ts:45-50
  • [medium] Opaque-origin cookie requests remain authorized — src/gateway/control-ui-plugin-origin-gate.ts:36
  • [medium] Loopback trust lacks verified client locality — src/gateway/control-ui-plugin-origin-gate.ts:45
Agent review details

Security

Needs attention: The patch narrows one CSRF path but leaves an acknowledged opaque-origin route and omits a locality input needed by the shared validator.

PR surface

Source +58, Tests +121. Total +179 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 58 0 +58
Tests 1 121 0 +121
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 179 0 +179

Review metrics

Metric Value Why it matters
Regression coverage growth production +58 lines, tests +121 lines The production growth adds a security gate; the tests exercise HTTP status outcomes but do not establish final handler effects.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #116241
Summary: The linked open issue describes the cookie-path Origin gap; this PR proposes a partial fix for that same path.

Members:

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

Merge-risk options

Maintainer options:

  1. Prove and complete the boundary (recommended)
    Pass verified locality, demonstrate allowed and forbidden handler effects, and settle frame authorization with the security owner before merge.
  2. Own the partial protection
    A security owner may explicitly approve the residual opaque-origin exposure after the locality defect and proof gap are resolved.

Technical review

Best possible solution:

Use verified request locality in the shared Origin check, prove the decision at the plugin handler, and have the security owner choose a frame-bound authorization contract or explicitly accept this narrower hardening while keeping the linked issue open.

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

Yes for the source-level gap: current main authorizes a valid plugin cookie without checking Origin. The PR's supplied trace compares direct authorization results, but no browser-to-handler reproduction is shown.

Is this the best way to solve the issue?

Unclear. Reusing the shared Origin validator is a narrow improvement, but it needs verified request locality and a maintainer-approved answer for opaque-frame authority.

Full review comments:

  • [P2] Pass verified request locality to the Origin check — src/gateway/control-ui-plugin-origin-gate.ts:45-50
    The new call omits isLocalClient. With an undefined value, the shared validator accepts a matching loopback Host even for a non-local request; its existing tests require rejection when locality is false. Pass isLocalDirectRequest(req) and cover direct, forwarded, and non-local cases.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded but security-relevant Gateway authentication improvement with unresolved boundary and proof work.
  • merge-risk: 🚨 compatibility: The new gate can reject plugin-cookie requests from concrete Origins that existing setups currently authorize.
  • merge-risk: 🚨 security-boundary: The gate omits verified locality and retains browser-reachable opaque-origin authorization.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Linux terminal trace mints a production cookie and compares authorization results, but does not show the HTTP plugin handler's final effect for an intended frame, a forbidden concrete Origin, or an invalidated cookie. Redacted browser/network logs or terminal traces showing those effects would address the gap; the opaque-origin contract also needs a security decision. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Opaque-origin cookie requests remain authorized — src/gateway/control-ui-plugin-origin-gate.ts:36
    The new gate accepts Origin: null, which the intended sandbox and an attacker-controlled opaque sandbox can both produce. A security owner must choose and verify the intended frame-authority boundary.
    Confidence: 0.94
  • [medium] Loopback trust lacks verified client locality — src/gateway/control-ui-plugin-origin-gate.ts:45
    The shared validator receives no direct-client signal, so its loopback same-host rule can authorize requests it would reject with isLocalClient: false.
    Confidence: 0.94

What I checked:

  • Pinned introduced change: The PR adds a cookie-specific Origin gate and calls it after validating cookie grants. (src/gateway/http-auth-plugin-cookie.ts:65, 4fd398b19f58)
  • Current main remains affected: The fetched current-main cookie authorization path validates grants and profile authority without checking browser Origin. (src/gateway/http-auth-plugin-cookie.ts:40, e380838e4665)
  • Locality finding remains: The new call omits isLocalClient. The shared validator accepts a matching loopback Host when that value is undefined, while its tests explicitly reject that match for a non-local client. (src/gateway/control-ui-plugin-origin-gate.ts:45, 4fd398b19f58)
  • Opaque-origin limitation: The gate permits null and absent Origins; the PR body acknowledges that an attacker-controlled opaque sandbox can also send a null Origin. The default plugin-tab sandbox uses allow-scripts without allow-same-origin. (src/gateway/control-ui-plugin-origin-gate.ts:36, 4fd398b19f58)
  • Handler boundary: Gateway HTTP stages authorize the plugin request before passing the resulting authority and scopes to the plugin handler. (src/gateway/server-http.ts:642, 4fd398b19f58)
  • Prior review continuity: The supplied prior completed review raised the locality finding and requested final-handler proof. The current head retains the missing locality argument, and the PR body still reports authorization results rather than observable handler effects. (4fd398b19f58)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jacqueline Henriksen: 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.

  • Pass verified locality and cover direct-loopback, forwarded, and non-local requests.
  • Add final-effect proof for the intended plugin frame, the nearest forbidden browser request, and generation-invalidated cookies; redact credentials, addresses, endpoints, and user data.
  • Obtain current-head security approval for the chosen opaque-origin contract and retain the linked issue if the accepted scope remains partial.

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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T04:11:19.923Z sha a746c55e0591152eb51af2247b3a3a87d4b60f4e :: needs real behavior proof before merge. :: [P1] Preserve the opaque sandbox request
  • reviewed 2026-08-05T05:04:56.282Z sha 1980f0bf72ffd47cb0622a54849c6c75518bb088 :: needs real behavior proof before merge. :: [P1] Reject opaque-origin cross-site cookie requests
  • reviewed 2026-08-05T07:19:51.022Z sha 1980f0bf72ffd47cb0622a54849c6c75518bb088 :: needs real behavior proof before merge. :: [P1] Reject opaque-origin cross-site cookie requests
  • reviewed 2026-08-05T07:37:53.716Z sha 1980f0bf72ffd47cb0622a54849c6c75518bb088 :: needs real behavior proof before merge. :: [P1] Require a frame-bound credential for opaque-origin requests | [P1] Reject cross-site requests with no Origin
  • reviewed 2026-08-18T06:28:27.693Z sha 535745f1b7a5f09758449287eb48904533d338bf :: needs real behavior proof before merge. :: [P1] Bind opaque-origin requests to the intended frame
  • reviewed 2026-09-15T09:20:59.798Z sha 78da8acc4f60718068404d3ff8efa513c2778a18 :: needs real behavior proof before merge. :: [P2] Pass verified request locality to the Origin validator
  • reviewed 2026-09-20T06:24:25.564Z sha a5dfaa3fb79ea073509c4a60fab0ba7ca3e83b72 :: needs real behavior proof before merge. :: [P2] Pass verified request locality to the Origin validator
  • reviewed 2026-09-20T06:54:15.451Z sha 73751f2f63bbdfa404ba27866341a27665a8d515 :: needs real behavior proof before merge. :: [P2] [P2] Pass verified request locality to the Origin validator

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 5, 2026
@miorbnli
miorbnli force-pushed the fix/control-ui-cookie-origin-check branch from 1980f0b to 535745f Compare August 18, 2026 06:18
@miorbnli
miorbnli force-pushed the fix/control-ui-cookie-origin-check branch from 535745f to 78da8ac Compare September 15, 2026 09:13
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed 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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Sep 15, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Maintainer security review required

This external contributor PR changes sensitive security components. A maintainer must review these changes before merging.

Current SHA: 4fd398b19f584589633bedf2d3bc05329191ca96

These sensitive security changes were made:

  • src/gateway/http-auth-plugin-cookie.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

After reviewing the changes, post a new PR comment containing only approval commands, each on its own line:

/allow-security-sensitive-change

A later push requires a fresh approval comment.

@miorbnli
miorbnli force-pushed the fix/control-ui-cookie-origin-check branch from a5dfaa3 to 73751f2 Compare September 20, 2026 06:43
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Sep 20, 2026
@miorbnli
miorbnli force-pushed the fix/control-ui-cookie-origin-check branch from 73751f2 to 4fd398b Compare September 29, 2026 02:04
@miorbnli

Copy link
Copy Markdown
Contributor Author

CI failure attribution on head 4fd398b19f (run 36510907373): the failing shards fail in files this diff does not touch — server.sessions.reset-cleanup.test.ts (whole-file failure pattern) and server.catalog-startup.test.ts (provider-settings startup). Both files pass locally on the exact head (25/25 across the two files). main CI is green on newer commits, and sibling PRs' runs the same day show the same scattered-shard pattern — the known runner-load flake family. The cookie-origin diff itself re-verified green locally before push (server.plugin-frame-auth.test.ts 12/12). A maintainer rerun should clear these. The remaining openclaw/security-sensitive-review item is a maintainer-owned review gate, not a code failure.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @miorbnli for identifying and documenting this gap. Closing this partial implementation after security review: the Origin: null exception retains the opaque-origin attack, while rejecting it would break the default plugin-frame contract introduced in #107323 (efa8075c6831faf8400e6bc40c4f52f401d449d2). The PR body records the current-main reproduction and origin matrix. #116241 remains open; the concrete-Origin regression and reuse of the existing origin validator are worth carrying into a compatible frame-authorization fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-review-required security-sensitive-changed size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control-UI plugin-tab cookie auth skips browser-Origin check (bearer path has it); blind CSRF on GET/HEAD plugin routes

2 participants