-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Description
Security Issue: Incomplete IPC Origin Validation
Severity: MEDIUM
Location: src/main/windows/main.ts (various IPC handlers)
Description
Only auth:* handlers validate sender origin. Other IPC handlers lack origin validation.
Current State
// Auth handlers - properly validated ✓
if (!validateSender(event.senderFrame)) {
return { success: false, error: "Unauthorized origin" }
}
// Other handlers - no validation ✗
ipcMain.handle("window:open", ...)
ipcMain.handle("clipboard:*", ...)Risk
- Window open handlers not origin-validated
- Clipboard operations not protected
- Could be exploited if malicious content loads in app
Recommendation
Apply validateSender pattern to all sensitive IPC handlers:
const validateIPC = (event: Electron.IpcMainInvokeEvent) => {
if (!validateSender(event.senderFrame)) {
throw new Error("Unauthorized IPC origin")
}
}
ipcMain.handle("window:open", async (event, url) => {
validateIPC(event)
// ... handler logic
})Handlers to Protect
window:*- Window managementclipboard:*- Clipboard accessfile:*- File system operations- Any handler that accesses system resources
Labels: security, ipc
Metadata
Metadata
Assignees
Labels
No labels