Repository navigation
fix: external plugin tabs fail under gateway auth - #107323
Conversation
|
Codex review: needs changes before merge. Reviewed July 15, 2026, 11:14 PM ET / July 16, 2026, 03:14 UTC. Summary PR surface: Source +260, Tests +250. Total +510 across 8 files. Reproducibility: yes. The linked issue provides a concrete v2026.7.1 browser reproduction, and the contributor’s Chromium run against a real Gateway observes the relevant before-and-after HTTP outcomes. Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Authorize the cookie against the resolved plugin route or descriptor identity, preserving child assets owned by that route while denying separately registered nested routes. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue provides a concrete v2026.7.1 browser reproduction, and the contributor’s Chromium run against a real Gateway observes the relevant before-and-after HTTP outcomes. Is this the best way to solve the issue? No, not yet. A signed cookie handoff is maintainable, but request-path prefix alone is not the narrowest safe authority when supported nested plugin routes can overlap. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 957cc81175a3. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +260, Tests +250. Total +510 across 8 files. View PR surface stats
Security concerns:
Acceptance criteria:
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
Review history (9 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated the PR body with redacted live browser proof on head |
|
Rebased onto current main and refreshed the proof on head |
|
Verification update after rebasing onto latest
|
|
Rebased onto current Verification after rebase:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Follow-up: Verification after this rebase:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Rebased again onto current Verification after this rebase:
The previous failed Actions appeared to be transient GitHub/API/base-fetch failures rather than failures in this PR. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Added an inspectable proof harness on a throwaway branch, separate from this PR branch: Command run locally from that branch: Result: The prototype uses Chromium against a real Redacted proof matrix from The generated artifact redacts loopback port and token values. The prototype source is intentionally not part of this PR; it is linked as inspectable browser proof for the credential/cookie behavior requested by review. @clawsweeper re-review |
|
Merged via squash.
|
* fix: load plugin tabs with gateway auth * fix: harden plugin tab cookie signature compare * fix(gateway): authenticate external plugin tabs Co-authored-by: Paul Pitchford <[email protected]> * refactor(gateway): simplify plugin frame auth proof --------- Co-authored-by: Peter Steinberger <[email protected]>
* fix: load plugin tabs with gateway auth * fix: harden plugin tab cookie signature compare * fix(gateway): authenticate external plugin tabs Co-authored-by: Paul Pitchford <[email protected]> * refactor(gateway): simplify plugin frame auth proof --------- Co-authored-by: Peter Steinberger <[email protected]>
Closes #107255
What Problem This Solves
External plugin Control UI tabs rendered in sandboxed iframes cannot attach the Gateway bearer header, so gateway-authenticated plugin routes fail with
401 Unauthorized.Security Decision
The authenticated Control UI bootstrap now mints five-minute, signed, HttpOnly frame grants only for visible external tabs that declare
auth: "gateway". Each grant is bound to the plugin id, canonical route path, exact-or-prefix match mode, and current Gateway auth generation.The plugin HTTP auth stage accepts a valid grant only for
GETandHEAD, always derivesoperator.read, and rejects it for mutation requests and WebSockets. Per-process, per-plugin cookie names prevent plugins with the same route root from sharing a credential.Before mounting the real plugin iframe, the UI runs an authenticated Gateway-owned probe inside an opaque sandbox. Blocked third-party cookies, insecure non-local HTTP contexts, expired grants, or route mismatches leave the plugin iframe unmounted. The probe uses an exact parent origin, a restrictive
frame-ancestorspolicy, and never exposes plugin content or auth state cross-origin.The browser cookie is a hostname credential boundary; ports do not isolate cookies. Documentation now warns operators not to co-host mutually untrusted services on the Gateway hostname.
SameSite=None; Secureis required because opaque sandbox descendants are cross-site; the live probe provides fail-closed browser-policy detection.Plugin-managed-auth tabs remain direct and unchanged. Query/fragment tab descriptors share one canonical pathname resolver across server and UI grant matching.
User Impact
Gateway-authenticated external plugin tabs work without exposing the shared Gateway token in iframe URLs, JavaScript, plugin requests, or plugin runtime scopes.
Evidence
2d56aaef95553d3d1d39b6269bc0abfee2a68a40: CI run 29505922873node scripts/run-vitest.mjs src/gateway/control-ui-plugin-tabs.test.ts src/gateway/control-ui.http.test.ts src/gateway/server.plugin-http-auth.test.ts src/gateway/server.plugin-frame-auth.test.ts ui/src/app/config.test.ts ui/src/pages/plugin/plugin-page.test.tsoxlint,oxfmt --check, andgit diff --checkcheck:test-types, and full Gateway/SDK/Control UI build passed for the security implementation.200;Authorizationheader;operator.read;POSTrequests were rejected.AI-assisted: yes. Codex performed whole-surface review, implementation, regression coverage, exact-head CI validation, Testbox validation, and real-browser proof. The maintainer reviewed the resulting security boundary and evidence before landing.