openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Security: Unvalidated Tauri IPC payloads in webviewAccountService.ts

Open Liohtml opened this issue 6 months ago • 0 comments

Summary

app/src/services/webviewAccountService.ts deserializes data arriving via Tauri IPC events (webview:event) using unchecked as casts (e.g., evt.payload as IngestPayload). No schema validation is performed.

If a compromised or malformed event payload contains unexpected field types, downstream code like persistIngestToMemory and handoffToOrchestrator will consume them without validation, potentially writing attacker-controlled content to the AI memory store.

Location

app/src/services/webviewAccountService.ts — handleRecipeEvent, ingest/caption paths

Impact

Medium — Attacker-controlled content injected into the memory store or orchestrator prompt via crafted IPC events.

Suggested Fix

Add zod schema validation on each payload variant before processing:

const IngestPayloadSchema = z.object({
  title: z.string(),
  content: z.string(),
  source: z.enum(['gmail', 'drive', 'notion', ...]),
});

const parsed = IngestPayloadSchema.safeParse(evt.payload);
if (!parsed.success) { log.warn('Invalid IPC payload'); return; }

Liohtml avatar May 16 '26 14:05 Liohtml