electron-security-hardening
Installation
SKILL.md
Electron Security Hardening
Harden Electron by narrowing every trust boundary between Chromium, Node.js, the OS, local files, and update infrastructure.
Process
- Identify the app trust model: local UI, remote content, preload APIs, IPC handlers, sessions, custom protocols, file access, secrets, and updater.
- For an existing repo, detect the pinned Electron version and tooling before relying on defaults. For a new project, use latest stable. For security-sensitive defaults, fuses, protocol privileges, signing, or update validation, verify official docs through
itsol-current-tech-context. - Implement controls at the trusted boundary: main process, session, protocol handler, preload contract, IPC handler, package/build config, and CI release gate.
- Add negative tests or review evidence for bypasses: XSS payloads, bad origins,
javascript:/file:URLs, untrusted sender frames, path traversal, symlink escape, stale sessions, and tampered updates. - Do not rely on renderer-only checks, obfuscation, ASAR secrecy, or user-controlled URLs for security decisions.
Baseline
Production windows should have nodeIntegration: false, contextIsolation: true, sandbox: true, webSecurity: true, allowRunningInsecureContent: false, controlled DevTools, CSP, explicit navigation policy, permission handlers, typed preload APIs, sender-aware IPC, signed releases, and update integrity.