Electron security
The Electron hardening checklist — context isolation, sandbox, no nodeIntegration, strict CSP, navigation/window.open allowlists, IPC input validation, and safe handling of remote content. USE WHEN auditing or hardening an Electron app, reviewing webPreferences, or before shipping. Follows Electron's official security recommendations.From its SKILL.md
npx -y skills add Sheshiyer/skill-clusters --skill electron-securityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.6 KB, 541 tokens by cl100k_base, as published. Nobody here has run it
Electron Security
The renderer runs web content with a powerful process behind it; a single XSS in a misconfigured window can become full RCE on the user's machine. This is the checklist (aligned with Electron's official "Security" guidance).
Window configuration (every BrowserWindow)
- ✅
contextIsolation: true— never disable. - ✅
nodeIntegration: false(andnodeIntegrationInWorker/InSubFrames: false). - ✅
sandbox: true. - ✅
webSecurity: true(never disable to "fix" CORS). - ❌ No
@electron/remote.
Content & navigation
- Strict CSP via response headers or
<meta>— nounsafe-inline/unsafe-eval; allowlist sources. - Allowlist navigation: handle
will-navigateandsetWindowOpenHandler—denyby default, open external URLs in the user's browser (shell.openExternalafter validating the URL). - Only load content you trust. Prefer bundled local files; if you must load remote content, treat it as hostile and never give it Node/IPC power.
- Validate any URL passed to
shell.openExternal(nofile:/arbitrary schemes).
IPC & data
- Validate every IPC argument in main (type, range, path). The renderer is the attacker.
- No path traversal: resolve and confine file paths to expected roots.
- Don't expose privileged operations as generic ("runCommand") bridge methods.
Process & supply chain
- Keep Electron up to date — you inherit Chromium/V8 CVEs; track the supported release line.
- Audit dependencies (renderer deps run in the page); pin and review native modules.
- Set
app.enableSandbox()early; consider a fuse/@electron/fusesto disablerunAsNodeetc.
Pre-ship checklist
- All windows: contextIsolation✓ nodeIntegration✗ sandbox✓ webSecurity✓
- Minimal typed
contextBridgeAPI; no raw ipc/Node onwindow - Strict CSP; navigation +
window.opendeny-by-default - All IPC inputs validated in main
- Electron on a current supported version; deps audited
- App signed + notarized (
electron-builder-packaging)
Guardrails
If any item above is unchecked, the app is not ship-ready. Hardening is not optional for an app that ships Chromium + Node to end users.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most security skills give in 541 tokens
Counted across 648 of the 828 authors here whose files we hold, read 2026-08-07
- Parameterize all database queriesin 68 of 648, across 51 files
- Hash passwords using bcrypt, scrypt, or argon2in 49 of 648, across 36 files
- Apply rate limiting to authentication endpointsin 48 of 648, across 24 files
- Configure security headersin 35 of 648, across 19 files
- Validate all inputsin 32 of 648, across 24 files
- Validate all external input at the system boundaryin 29 of 648, across 19 files
- Run containers as a non-root userin 28 of 648, across 15 files
- Use httponly secure samesite cookies for sessionsin 26 of 648, across 15 files
- Run dependency audits before every releasein 21 of 648, across 10 files
- Encode output to prevent cross-site scriptingin 21 of 648, across 11 files
- Copy dependencies before source codein 20 of 648, across 9 files
- Store secrets in environment variablesin 20 of 648, across 18 files
Said here and by no other author read
- keep web security enabled
- confine file paths to expected roots
- keep Electron up to date
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.