desktop-security-electron

Installation
SKILL.md

Electron Security & Fuses

Quick Guide: Electron fuses are compile-time security flags flipped via @electron/fuses before code signing. Disable RunAsNode, EnableNodeOptionsEnvironmentVariable, EnableNodeCliInspectArguments, and GrantFileProtocolExtraPrivileges. Enable EnableCookieEncryption, EnableEmbeddedAsarIntegrityValidation, and OnlyLoadAppFromAsar. Rely on secure defaults: contextIsolation: true (Electron 12+), sandbox: true (Electron 20+), nodeIntegration: false (Electron 5+). Set a restrictive Content Security Policy. Use setPermissionRequestHandler to deny all permissions except an explicit allowlist. Block navigation and new-window creation.


<critical_requirements>

CRITICAL: Before Using This Skill

(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)

(You MUST restrict permissions via session.setPermissionRequestHandler() -- Electron grants most permissions by default, including camera, microphone, and geolocation)

Installs
36
GitHub Stars
26
First Seen
Jul 25, 2026