Skip to content

feat(plugins): add sandboxed panel host and renderer - #8461

Closed
nwparker wants to merge 2 commits into
nwparker/plugins-p0-kernel-corefrom
nwparker/plugins-p0-panel-host
Closed

nwparker wants to merge 2 commits into
nwparker/plugins-p0-kernel-corefrom
nwparker/plugins-p0-panel-host

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Adds the experimental renderer-facing panel layer on top of #8460:

  • Host-generated panel shell injects strict CSP before plugin content parses: default-src 'none', no network connections, inline script/style only, and data-only image/font sources.
  • Sandboxed iframe uses allow-scripts without allow-same-origin; panel HTML is delivered through host-owned srcDoc.
  • Realpath containment rejects panel entries that resolve outside the installed plugin tree.
  • Bridge admission binds the host-owned plugin identity, verifies event.source, validates Host API parameters, and enforces per-plugin size/rate/pending budgets.
  • Watchdog demotes unresponsive or busy-looping panels to persistent host-owned error badges.
  • Fresh iframe revisions support recovery, theme changes, and development hot reload.
  • Curated Orca design tokens and light/dark classes are injected without exposing the full application stylesheet.
  • Right-sidebar plugin routes are normalized only after authoritative discovery; uninstalled tabs are dropped while feature-flag-disabled routes are preserved.

All panel extension points remain experimental.

Security evidence

Serialized Electron 43.1.0 acceptance run on macOS:

  • Hostile fetch and image exfiltration attempts were blocked by CSP.
  • Top-level and nested navigation attempts were contained.
  • Oversized and flood bridge traffic was rejected/rate-limited.
  • The hostile iframe ran in a renderer process separate from the host.
  • A busy-loop panel was detected, suspended, and represented by a host-owned error badge.
  • A symlinked panel entry is refused by automated realpath-containment coverage.

Command:

pnpm exec playwright test tests/e2e/plugin-demo.spec.ts tests/e2e/plugin-panel-containment.spec.ts tests/e2e/plugin-startup-budget.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1

Result: 4 passed in 1.1 minutes.

The approved screenshot uploader could not obtain a GitHub upload token. Evidence is therefore recorded as the reproducible transcript above; local screenshots were deliberately not committed. Process-isolation live evidence is currently macOS-only. Signed packaged-app and Windows/Linux evidence remain CI/follow-up work.

Validation

Validated at the top of the stack:

  • pnpm typecheck — passed.
  • pnpm lint — passed; only pre-existing warnings outside this stack.
  • Plugin/seam Vitest matrix — 55 files, 315 tests passed.
  • Startup unit gate — 20 samples, P95 2.63 ms.
  • Real Electron demo, containment, busy-loop, and startup A/B tests — 4 passed.

Stack

  1. feat(plugins): add experimental Phase 0 kernel #8460 — main-process kernel and enforcement.
  2. This PR: sandboxed panel host and renderer.
  3. Next: consent/settings UI and demo workflow.

Draft only — do not merge until the full stack has been reviewed together.

@nwparker
nwparker force-pushed the nwparker/plugins-p0-kernel-core branch from 0b360fd to 329c3da Compare July 13, 2026 03:06
@nwparker
nwparker force-pushed the nwparker/plugins-p0-panel-host branch from f5f0752 to 731a034 Compare July 13, 2026 03:06
@nwparker
nwparker force-pushed the nwparker/plugins-p0-panel-host branch from 731a034 to 695b4ad Compare July 13, 2026 10:32
@nwparker
nwparker force-pushed the nwparker/plugins-p0-kernel-core branch from 329c3da to 8f62c72 Compare July 13, 2026 10:32
@nwparker

Copy link
Copy Markdown
Contributor Author

Superseded by #8549, which condenses the whole plugin-system stack into a single PR against main.

@nwparker nwparker closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant