fix: address all final review findings for Phase 3

- CRITICAL: Fix command injection in discoveryService (execFile instead
  of exec, path validation regex)
- CRITICAL: Add Zod validation on discover API endpoint
- HIGH: Add Zod validation on discover/approve endpoint
- HIGH: Add array length limits to import schema (1000/100/100)
- HIGH: Fix theme broadcast echo loop (setTimeout vs queueMicrotask)
- MEDIUM: Singleton BroadcastChannel instead of create-per-send
- MEDIUM: Exclude sensitive APIs from service worker cache
- MEDIUM: Fix TypeScript cast errors in exportService tests
This commit is contained in:
2026-03-25 01:28:24 +03:00
parent 7d8a8fb0fc
commit 395ed821b7
9 changed files with 72 additions and 50 deletions
+3 -3
View File
@@ -240,9 +240,9 @@ const importSettingsSchema = z.object({
export const importDataSchema = z.object({
version: z.string(),
exportedAt: z.string(),
apps: z.array(importAppSchema),
boards: z.array(importBoardSchema),
groups: z.array(importGroupSchema),
apps: z.array(importAppSchema).max(1000),
boards: z.array(importBoardSchema).max(100),
groups: z.array(importGroupSchema).max(100),
settings: importSettingsSchema
});