一键导入
security-review
Review Electron security, IPC isolation, preload bridge safety, and input validation. Prevent common Electron security vulnerabilities in Cooper.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review Electron security, IPC isolation, preload bridge safety, and input validation. Prevent common Electron security vulnerabilities in Cooper.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | security-review |
| description | Review Electron security, IPC isolation, preload bridge safety, and input validation. Prevent common Electron security vulnerabilities in Cooper. |
Review Electron security, IPC isolation, preload bridge safety, and input validation. Prevent common Electron security vulnerabilities in Cooper.
src/preload/preload.tssrc/main/| Rule | Check | Severity |
|---|---|---|
No nodeIntegration: true | webPreferences in main.ts | 🔴 Critical |
No contextIsolation: false | webPreferences in main.ts | 🔴 Critical |
No remote module | Anywhere in codebase | 🔴 Critical |
| No Node.js globals in renderer | src/renderer/ files | 🔴 Critical |
| All IPC goes through preload | No direct ipcRenderer in renderer | 🟡 High |
| Input validation on IPC handlers | ipcMain.handle() callbacks | 🟡 High |
| No shell injection | child_process / PTY usage | 🔴 Critical |
| No path traversal | File system operations | 🟡 High |
For each IPC channel:
copilot.*, git.*, voice.*, system.*, mcp.* prefixesSafe IPC exposure (preload.ts):
// ✅ Good: namespaced, typed, minimal surface
copilot: {
sendMessage: (sessionId: string, message: string) =>
ipcRenderer.invoke('copilot:send-message', sessionId, message),
}
// ❌ Bad: raw IPC access exposed
ipcRenderer: ipcRenderer // NEVER DO THIS
Safe input validation (main.ts):
ipcMain.handle('system:open-path', async (_, path: string) => {
// ✅ Validate before acting
if (!path || typeof path !== 'string') throw new Error('Invalid path');
const resolved = resolve(path);
if (!resolved.startsWith(allowedBase)) throw new Error('Path not allowed');
// proceed...
});
Evaluate code quality and suggest refactoring opportunities before committing. Ensure Cooper's codebase stays clean and maintainable.
Build comprehensive task context before making changes. Track constraints, dependencies, and execution order across multi-file work in Cooper's Electron architecture.
Define patterns for integrating with the Copilot SDK in Cooper. Cover session management, model switching, tool execution, event handling, and agent support.
Define and enforce IPC communication patterns between Cooper's main process, preload bridge, and renderer. Ensure all cross-process communication follows the secure, typed preload bridge pattern.
Create atomic commits with descriptive messages. Maintain clean git history for the Cooper project.
Decompose tasks into sub-tasks, assess risk, and create implementation checklists before starting work on Cooper features.