desktop-security-electron
Electron Security & Fuses
Quick Guide: Electron fuses are compile-time security flags flipped via
@electron/fusesbefore code signing. DisableRunAsNode,EnableNodeOptionsEnvironmentVariable,EnableNodeCliInspectArguments, andGrantFileProtocolExtraPrivileges. EnableEnableCookieEncryption,EnableEmbeddedAsarIntegrityValidation, andOnlyLoadAppFromAsar. Rely on secure defaults:contextIsolation: true(Electron 12+),sandbox: true(Electron 20+),nodeIntegration: false(Electron 5+). Set a restrictive Content Security Policy. UsesetPermissionRequestHandlerto deny all permissions except an explicit allowlist. Block navigation and new-window creation.
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST flip fuses BEFORE code signing -- the OS enforces fuse state after signing, so flipping after signing invalidates the signature)
(You MUST disable RunAsNode, EnableNodeOptionsEnvironmentVariable, EnableNodeCliInspectArguments, and GrantFileProtocolExtraPrivileges fuses in production builds -- these are the most commonly exploited attack vectors)
(You MUST enable both EnableEmbeddedAsarIntegrityValidation AND OnlyLoadAppFromAsar together -- enabling integrity validation alone still allows bypassing via the app code search path)
(You MUST NOT override security defaults (contextIsolation: true, sandbox: true, nodeIntegration: false) -- each one unlocks a critical attack surface)