fix(electron): retain scoped IPC registration provenance (#7031)

* fix(electron): retain scoped IPC registration provenance

* fix(electron): defer mutation analysis until scoped receiver admission
This commit is contained in:
Wenyu Chiou
2026-10-24 15:57:02 -04:00
committed by GitHub
parent 2acdd54130
commit c7ae27807f
12 changed files with 546 additions and 36 deletions
@@ -67,10 +67,17 @@ const locatedHandler = {
]),
handler_location: range,
};
const ipcReceiver = z
.strictObject({
kind: z.enum(["web-contents", "main-frame"]),
owner_location: range,
})
.exactOptional();
const ipcChannel = <Shape extends z.ZodRawShape>(shape: Shape) =>
z.union([
z.strictObject({
...findingContext,
receiver: ipcReceiver,
invocation_location: range.optional(),
resolution_basis: z.literal("wrapper-substitution").optional(),
...shape,
@@ -79,6 +86,7 @@ const ipcChannel = <Shape extends z.ZodRawShape>(shape: Shape) =>
}),
z.strictObject({
...findingContext,
receiver: ipcReceiver,
invocation_location: range.optional(),
resolution_basis: z.literal("wrapper-substitution").optional(),
...shape,