electron-security

仓库创建 2026年7月1日最近提交 23 天前SkillHot 收录 22 天前
▸ 精选理由

把渲染器视为不可信的统一原则,提供实用落地配置建议。

这个 Skill 做什么

针对 Electron 应用的一套渲染器隔离与 IPC/导航安全规则。

帮你把 Electron 桌面应用的渲染器当成不受信任的一端来隔离:封锁 nodeIntegration、启用 contextIsolation/sandbox、用 contextBridge 和 IPC 白名单限制通道,给外部链接和导航加防护,并保护深度链接和敏感存储(safeStorage)。在开发或审计 Electron 应用、处理 XSS/重定向风险或设计 IPC 时用到。特别之处是把边界先上锁,认为任何渲染器命令都可能被利用,从而把 Node、文件系统和会话令牌切断。

▸ 展开 SKILL.md 英文原文

Harden Electron apps: renderer trust boundary (nodeIntegration, contextIsolation, sandbox), contextBridge/IPC allowlists, shell.openExternal, navigation guards, deep-link auth, safeStorage

开发编程Electron渲染器隔离IPC安全通用
2
Stars
0
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/electron-security/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/electron-security/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Electron Desktop Security

## Rules (for AI agents)

The unifying principle: **treat the renderer as untrusted**. Any renderer-side
code execution (XSS in rendered content, a redirect, a deep link) must NOT be
able to reach Node, the shell, the filesystem, or session tokens. Lock the
renderer-trust boundary first; every IPC sink is reachable from a compromised
renderer.

### ALWAYS
- Configure every `BrowserWindow` with `nodeIntegration: false`,
  `contextIsolation: true`, and `sandbox: true`. The preload + contextBridge
  is the supported way to give the renderer capabilities — the page never
  needs Node.
- Expose a **minimal, typed** API from the preload via `contextBridge.exposeInMainW
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有