Security: Privileged IPC handlers lack sender/origin validation#569
Security: Privileged IPC handlers lack sender/origin validation#569tomaioo wants to merge 1 commit intoximu3:mainfrom
Conversation
The IPC manager registers handlers/listeners without validating the sender frame origin, URL, or trust level. Any renderer that can access IPC may invoke sensitive main-process operations (database writes, filesystem actions, updater actions, plugin lifecycle), creating a high-impact privilege-escalation path if renderer content is compromised. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
|
The security concern is valid in principle, but this implementation is not. It introduces calls to Even if the missing method were added, the approach is still incomplete: passing only There is also at least one direct In short: the problem statement is reasonable, but the patch is a hallucinated and non-building partial implementation. Please do not submit security fixes that have not been compiled, run, or checked against the actual Electron IPC threat model. Review drafted by GPT-5.4, since apparently we are reviewing bot-generated code with another model. Unfortunately, the model that produced this PR does not appear to have been particularly smart: it invented a missing method, missed existing raw IPC handlers, and seemingly did not have a working local development environment. |
Summary
Security: Privileged IPC handlers lack sender/origin validation
Problem
Severity:
High| File:src/main/core/ipc/IPCManager.ts:L15The IPC manager registers handlers/listeners without validating the sender frame origin, URL, or trust level. Any renderer that can access IPC may invoke sensitive main-process operations (database writes, filesystem actions, updater actions, plugin lifecycle), creating a high-impact privilege-escalation path if renderer content is compromised.
Solution
Implement centralized sender validation (e.g., allowlist trusted origins/windows/webContents IDs) before dispatching handlers. Add per-channel authorization checks and minimize exposed channels. Consider context isolation + strict preload API surface with explicit permission checks.
Changes
src/main/core/ipc/IPCManager.ts(modified)