Lock main window to the Sunburn origin #6

Closed
opened 2026-10-03 09:24:06 -04:00 by adam · 1 comment
Owner

Problem: No setWindowOpenHandler / will-navigate guard, and the permission handler grants media/display-capture/notifications to any origin.

Impact: A link clicked in chat (or any navigation) opens a third-party site inside Electron, inheriting the preload bridge and auto-granted camera/mic/screen permissions.

Fix:

  • setWindowOpenHandler → shell.openExternal for non-Sunburn URLs, deny.
  • will-navigate → block anything outside https://chat.galactica.host.
  • Permission handler: check webContents.getURL() origin before granting.
  • Validate loadLastUrl() is on the Sunburn origin before loading.

Where: main.js:28-47

**Problem:** No `setWindowOpenHandler` / `will-navigate` guard, and the permission handler grants media/display-capture/notifications to any origin. **Impact:** A link clicked in chat (or any navigation) opens a third-party site inside Electron, inheriting the preload bridge and auto-granted camera/mic/screen permissions. **Fix:** - `setWindowOpenHandler` → `shell.openExternal` for non-Sunburn URLs, `deny`. - `will-navigate` → block anything outside `https://chat.galactica.host`. - Permission handler: check `webContents.getURL()` origin before granting. - Validate `loadLastUrl()` is on the Sunburn origin before loading. **Where:** `main.js:28-47`
Author
Owner

Fixed by #13 (#13)

Fixed by #13 (https://git.galactica.host/adam/sunburn-desktop/pulls/13)
adam closed this issue 2026-10-03 11:57:27 -04:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
adam/sunburn-desktop#6
No description provided.