安全漏洞 / 高 / 后端服务
electron/services/window-manager.service.ts
WindowManager 创建 BrowserWindow 时配置:
new BrowserWindow({ webPreferences: { sandbox: false, // 削弱了沙箱 nodeIntegration: false, contextIsolation: true, }, });
sandbox: false 允许渲染进程访问 Node.js API(即使 contextIsolation: true):
sandbox: false
new BrowserWindow({ webPreferences: { sandbox: true, // 启用沙箱 nodeIntegration: false, contextIsolation: true, preload: join(__dirname, 'preload.js'), }, });
启用 sandbox 后:
electron
可能需要重构部分 preload 代码,建议分阶段实施。
No dependencies set.
The note is not visible to the blocked user.
问题类型
安全漏洞 / 高 / 后端服务
文件位置
electron/services/window-manager.service.ts问题描述
WindowManager 创建 BrowserWindow 时配置:
sandbox: false允许渲染进程访问 Node.js API(即使 contextIsolation: true):影响
建议修复
启用 sandbox 后:
electron模块的子集(contextBridge、ipcRenderer 等)可能需要重构部分 preload 代码,建议分阶段实施。