Repository navigation
feat(desktop): Electron 45, sandboxed preloads, origin-pinned IPC [SAP-4382] - #1269
antoine-berger wants to merge 10 commits into
Conversation
…P-4382] - Electron 33 -> 45.1.0 (macOS 13 minimum). Preloads are bundled into one IIFE script each so every preload window can run with sandbox: true. - The IPC sender check and in-window navigation are pinned to the harness origin the main window loaded; other local origins open in the preview window. - Install-on-quit stays off on Windows until the build bakes a publisherName. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
pnpm update -r --no-save: no package.json change, electron stays 45.1.0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
/devin review |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…4382] electron-builder writes no minimumSystemVersion into latest-mac.yml, so an install on macOS 12 would auto-update into a build it cannot launch. pack.mjs --mac now stamps the Darwin version of macOS 13 into every *-mac.yml manifest; electron-updater (6.8.9+, what installs already run) skips an update whose minimumSystemVersion is above os.release(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nts [SAP-4382] - isTrustedSender now requires the calling frame to be the main window's top frame and reads its URL from that frame. - A null publisherName (empty, ~, null, comment-only) no longer re-enables install-on-quit on Windows. - mac.minimumSystemVersion 13.0 in the Info.plist. - Comments corrected or shortened where they no longer matched the code. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ate toggle [SAP-4382] Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…382] Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…AP-4382] Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…iour [SAP-4382] Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… [SAP-4382] The key hashed packages/harness/package.json, whose ^1.61.0 range did not change when the lockfile refresh moved Playwright to 1.64.1, so the job restored 1.61 browsers and every spec failed to launch chromium. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-4382] An empty version would turn the cache key into a constant and mask the next browser bump. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks for the thorough work on this, Antoine. We're going to pass on this one for now. The gap is real but narrow: it needs a user to open or run a project they chose to clone, on a surface (Studio / the local dev tooling) that isn't core product today. Against that, the change adds behaviour developers and customers will notice, and the cost of reviewing, releasing and supporting it is higher than the risk it removes. We'd rather keep the security effort on the server-side gaps (billing scope, payment replay, OAuth, auth claims), which are approved. Please close this PR and move the ticket to Canceled with a one-line note pointing here. If this area becomes core, or we see the gap exploited, we'll reopen it from the ticket. Specific to this one: the Electron 33 → 45 upgrade is worth doing as desktop maintenance on the Studio team's schedule, with macOS and Windows packaged builds tested before a |
Primary change type
Problem and motivation
Desktop hardening for Agent Studio (
@sapiom/harness-desktop): move to a supported Electron release and tighten the app's defaults (sandboxed preload windows, desktop IPC limited to the harness page, explicit restart for Windows updates until builds are code-signed).Summary and scope
electronVersioninelectron-builder.yml). Electron 44+ requires macOS 13:mac.minimumSystemVersionsets the Info.plist floor, andpack.mjs --macstampsminimumSystemVersion: 22.0.0(the Darwin version of macOS 13) into the*-mac.ymlupdate manifests, so installs on macOS 12 skip this update instead of installing a build they cannot launch (electron-updater 6.8.9+, what installs already run, honours the key).scripts/build-preloads.mjsbundles eachsrc/preload/*.mtswith esbuild into one IIFE script,dist/preload/<name>.cjs(ipc.tsinlined,electronthe only external). The setup, main and update windows now all run withsandbox: true.setTrustedWindow(win, origin)records the origin the main window loaded;isTrustedSenderrequires the call to come from the main window's top frame, on that exact origin, at/.will-navigatekeeps only that origin in the main window; other local origins open in the existing preview window (navigation-policy.ts).autoInstallAllowed(update-policy.ts) keepsautoInstallOnAppQuitoff on Windows until the bakedapp-update.ymlcarries a non-nullpublisherName. Downloads still happen; the update window hides the auto-update toggle and the update installs only through "Restart now". Lifts by itself once a signed build ships.pnpm update -r --no-save, nopackage.jsonchange.Out of scope: Windows code signing itself, an Intel macOS build, and the remaining advisories below (each needs a major bump or an upstream release).
Related work
Related issue or discussion: SAP-4382 (internal tracker).
Validation
Remaining
pnpm audit --prodadvisories, all blocked by a declared range:toml4.3.0 (3 advisories)@sapiom/opencode>@opencode-ai/plugin>effect@opencode-ai/pluginpinned to1.18.29zod4.1.8 / 3.25.76@opencode-ai/plugin,@sapiom/agent-mapzod ^3.25.0in agent-map (fix is in 4.6.6)uuid10.0.0@sapiom/agent-mapuuid ^10.0.0Tests and documentation
New:
navigation-policy.test.ts,trusted-sender.test.ts,preload-bundle.test.ts(bundles really are classic scripts requiring onlyelectron),window-sandbox.test.ts(every preload window keepssandbox: true,contextIsolation: true,nodeIntegration: false). Extended:update-policy.test.ts(autoInstallAllowed,withMinimumSystemVersionand itspack.mjswiring),dialogs.test.ts,paths.test.ts,update.html.test.ts. The packaged--smokechecks (preload-bridge,desktop-bridge) prove the bundled preloads load in sandboxed windows.packages/harness-desktop/CLAUDE.mdupdated.Compatibility and release impact
@sapiom/harness-desktopminor).Security
AI assistance
Claude Code (Craft Agent) planned and implemented the change from the tracked issue, then ran the checks listed above. The plan was fact-checked by an independent agent before implementation and the diff goes through an independent review before this PR leaves draft.
Checklist
CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.🤖 Generated with Claude Code