Skip to content
Back to skills

Electron Apps

ASecurity

Secure Electron desktop apps: context isolation, preload bridges, IPC validation, navigation guards and packaging

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentjavascripttypescriptrustgojavashellnodeapisecurity

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill electron-apps --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Electron Apps?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Electron Apps
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-electron-apps/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-electron-apps)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Secure Electron desktop apps: context isolation, preload bridges, IPC validation, navigation guards and packaging
profile: standard
tags: electron, desktop, security, typescript
---

# Electron apps

Use when configuring `BrowserWindow`, preload scripts, IPC channels, or Electron packaging/updates.

## Process isolation (non-negotiable)
Every renderer loading UI or remote/user-controlled content must set:
- `contextIsolation: true`
- `nodeIntegration: false`
- `sandbox: true`
- `webSecurity: true`

Never set `nodeIntegrationInWorker: true` or expose raw `ipcRenderer`, `fs`, or `child_process` on `window`.

## Preload and IPC boundaries
- Expose only explicit, narrow actions through `contextBridge.exposeInMainWorld("api", { ... })` instead of passing generic `invoke(channel, args)` wrappers.
- Validate every `ipcMain.handle` payload (schema check, path canonicalization) and verify `event.senderFrame.url` matches a trusted app origin before acting.

## Navigation and external links
- Restrict `webContents.on("will-navigate", ...)` to trusted app origins and deny `setWindowOpenHandler` for unknown schemes (`file://`, `javascript:`), delegating safe `https://` links to `shell.openExternal` only after parsing the URL.
- Enforce a strict `Content-Security-Policy` disabling `unsafe-eval` and remote inline scripts.

## Verify
Inspect `BrowserWindow` `webPreferences`, run unit tests for IPC sender/payload rejection, and package/run signed builds with `anvil app` check against `app.asar`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.