Skip to content

chore: ipc cleanup#1912

Merged
jkleinsc merged 8 commits intomainfrom
ipc-cleanup
May 5, 2026
Merged

chore: ipc cleanup#1912
jkleinsc merged 8 commits intomainfrom
ipc-cleanup

Conversation

@jkleinsc
Copy link
Copy Markdown
Member

@jkleinsc jkleinsc commented May 4, 2026

This PR reduces the scope of IPC exposed to the renderer process and adds input validation for filesystem-related handlers.

There were events inipcMainEvents that silently accepted fire-and-forget messages from the renderer even though no handler consumed them, so they have been removed.

Sender validation: The IpcMainManager constructor now verifies that every inbound ipcMain.on event originates from a window tracked by BrowserWindow.fromWebContents. Messages from WebViews, sub-frames, or detached/untracked windows are silently dropped.

Added input validation to three filesystem handlers before passing renderer-supplied values to fs operations.

CLEANUP_DIRECTORY — rejects any path that does not resolve inside os.tmpdir(), preventing path traversal to arbitrary filesystem locations.

DELETE_USER_DATA — rejects names containing path separators (/, path.sep) or .., so the renderer cannot escape app.getPath('appData').

PATH_EXISTS — type-checks the argument before calling fs.existsSync.


@jkleinsc jkleinsc requested review from a team and codebytere as code owners May 4, 2026 16:46
@coveralls
Copy link
Copy Markdown

coveralls commented May 4, 2026

Coverage Status

coverage: 88.606% (-0.4%) from 89.016% — ipc-cleanup into main

@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 88.986% (-0.4%) from 89.358% — ipc-cleanup into main

@jkleinsc jkleinsc merged commit 771bb13 into main May 5, 2026
16 checks passed
@jkleinsc jkleinsc deleted the ipc-cleanup branch May 5, 2026 15:19
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.

5 participants