Repository navigation
fix(security): put every trust decision on a host-owned token surface - #30710
Conversation
Plugin themes write CSS tokens on the document root, and dialogs portal to body, so any trust surface without plugin-security-chrome inherits them; a theme could hide what is being approved. The orca.yaml hook trust dialog, notebook run confirmation, plugin install, remove and rollback dialogs were missing it. DialogContent gains surface="security", which applies the host-owned tokens, and a scrollable prop for the plugin dialogs' existing viewport-height scrolling; every trust dialog uses the surface and a test lists them. The style guide says when to use each.
The agent command approval card (Allow/Deny) and the browser certificate override sit outside a dialog, so plugin theme tokens still reached them. A SecuritySurface primitive puts its child on the same host-owned token set as DialogContent surface="security"; both use it, and the security surface test now lists inline trust surfaces as well as dialogs.
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9c27c396-89f9-4a28-bcb9-d1f94d587640
📒 Files selected for processing: 14
docs/STYLEGUIDE.mdsrc/renderer/src/components/browser-pane/navigate/browser-load-failure-overlay.tsxsrc/renderer/src/components/editor/IpynbViewer.tsxsrc/renderer/src/components/native-chat/NativeChatApprovalCard.tsxsrc/renderer/src/components/settings/PluginConsentDialog.tsxsrc/renderer/src/components/settings/PluginInstallDialog.tsxsrc/renderer/src/components/settings/PluginMarketplacePreviewDialog.tsxsrc/renderer/src/components/settings/PluginMarketplaceSourceDialog.tsxsrc/renderer/src/components/settings/PluginRemoveDialog.tsxsrc/renderer/src/components/settings/PluginRollbackDialog.tsxsrc/renderer/src/components/sidebar/OrcaYamlTrustDialog.tsxsrc/renderer/src/components/ui/dialog.tsxsrc/renderer/src/components/ui/security-surface.test.tsxsrc/renderer/src/components/ui/security-surface.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| <SecuritySurface> | ||
| <div className="min-h-0 shrink overflow-hidden bg-chat-canvas"> |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
Secure the approval card’s chat colors.
When a plugin theme changes the root palette, this wrapper resets base tokens but leaves --chat-canvas and --chat-foreground inherited from the ancestor chat palette. The card uses bg-chat-canvas, and its plan content uses text-chat-foreground. A theme can therefore still change the appearance of content the user must review before approval. Reset the chat palette on this surface, or use host-owned tokens throughout the approval content. (raw.githubusercontent.com)
ELI5
Screens that ask you to trust or run code (repo hooks, notebook runs, plugin installs and approvals, agent command approvals, certificate overrides) should always look like Orca, never like a plugin wants them to. Only some of them were protected that way. Now all of them are, through one setting on the dialog.
What Changed
DialogContentgetssurface="security", which applies the existing host-owned token set (plugin-security-chrome), and ascrollableprop for dialogs whose whole body scrolls.orca.yamlhook trust, notebook run, plugin consent, install, marketplace preview and source, remove and rollback. Before, only some plugin dialogs applied the class by hand and theorca.yamland notebook dialogs did not.SecuritySurfacewrapper: the agent command Allow/Deny card in native chat and the browser's "proceed past certificate error" override. (Their diffs look large only because the markup is re-indented under the wrapper.)docs/STYLEGUIDE.mddocuments the rule.Today the visual result is identical, because nothing restyles these tokens yet.
Why
Upcoming plugin app themes override the app's color tokens. A dialog that approves code must not inherit them: a theme could make the confirm button invisible or the warning unreadable. Making it one prop on the shared dialog, plus a test, keeps the next trust dialog from forgetting.
Linked Issue
N/A (maintainer refactor).
Visual Proof
N/A — no visible change on main (no theme overrides these tokens yet). The protection is shown working under a plugin theme in the stacked theme PR.
Testing
dialog-security-surface.test.tsx; existing dialog and settings suites pass.pnpm tc:web,oxlint,check:code-quality:changedclean.--primaryset to pink) the consent dialog keeps host colors.Review
Agent skill upstream boundary
Notes
Behavior-preserving: no change for Linux/Windows/macOS, SSH, mobile, or older clients.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)