security-audit
Skill8 starsChanged 5 months agoMITView on GitHub
Systematic security audit for Electron apps. Scans attack surfaces, produces severity-tagged findings, generates implementation plan, and guides hardening.
- Reads credentials
193 other projects use a version of this.
Adopted by
Most recently taken up by
- argos-ci/argostheir own version, first seen Nov 9, 2026
- classroomio/classroomiotheir own version, first seen Nov 9, 2026
- dio-az/dotfilestheir own version, first seen Nov 8, 2026
- roke22/Squadratheir own version, first seen Nov 8, 2026
- qwwiwi/agentos-skills-publictheir own version, first seen Nov 8, 2026
- craigcossairt/trellistheir own version, first seen Nov 8, 2026
Used with
Projects with it also use create-stories, story-done and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
lilangMaxSkillcreate-stories
Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.
Also in 11 projects that use this
lilangMaxSkillstory-done
End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.
Also in 11 projects that use this
nicepkgSkillcommunity-led-growth
Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.
Also in 5 projects that use this
nicepkgSkillph-community-outreach
Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.
Also in 5 projects that use this
- +7 more from lilangMax
- +1 more from nicepkg
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 193
- ruvnet/claude-flow★ 80ksame name
- ruvnet/ruflo★ 79ksame name
- PostHog/posthog★ 40ksame name
- Donchitos/Claude-Code-Game-Studios★ 27ksame name
- cloudflare/security-audit-skill★ 18ksame name
- rommapp/romm★ 14ksame name
- kubeshark/kubeshark★ 12ksame name
- maximhq/bifrost★ 9.4ksame name
- mono/SkiaSharp★ 5.6ksame name
- MaxMiksa/Auto-Company★ 3.2ksame name
183 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accelerateSkill
- implement-issueSkill
- pipeline-engSkill
- pipeline-orchestrateSkill
- pipeline-peSkill
- pipeline-scorerSkill
- qa-acceleratedSkill
- qa-prSkill
- qa-webSkill
- releaseSkill
- review-feedbackSkill
- roadmap-prioritizationSkill
- roadmap-refinementSkill
- security-auditSkill
- accelerateSkill
- implement-issueSkill
- pipeline-engSkill
- pipeline-orchestrateSkill
- pipeline-peSkill
- pipeline-scorerSkill
- qa-acceleratedSkill
- qa-hitlSkill
- qa-prSkill
- qa-webSkill
- releaseSkill
- review-feedbackSkill
- roadmap-prioritizationSkill
- roadmap-refinementSkill
- screenshotsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 10 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 174 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Prefer deny-by-default over allowlisting
- Distinctive: line 31
Don't over-engineer — match security investment to actual threat model
- Distinctive: line 33
Pragmatism over paranoia: Not every theoretical attack justifies a fix:
- Distinctive: line 42
Read the codebase to understand the architecture before auditing.
- Distinctive: line 63
Run through each category systematically.
- Distinctive: line 125
Race condition: If a client (e.g., stdio bridge) sends requests before auth handshake completes, the server may reject them.
- Distinctive: line 230
After implementation, verify each group:
- Distinctive: line 247
Resolving connections before auth completes: When adding auth handshakes to existing socket connections, the promise must resolve AFTER the …
- Very specific: line 249
Non-constant-time token comparison: Use crypto.timingSafeEqual for all token/secret comparisons.
- Very specific: line 251
Dead code after adding guards: If start() throws without a token, then if (this.token) inside the request handler is dead code.
- Distinctive: line 253
Forgetting to
git fetch originbefore comparing branches: Always fetch before claiming a branch is up to date. - Very specific: line 255
Removing CSP entries without removing the code paths: If you tighten connect-src to remove a provider URL, verify no UI path still offers …
- Distinctive: line 257
Credential migration duplication: If the same "read legacy file → store in new system → delete legacy" pattern appears in multiple places, …
“Common” is measured: kept by at least 6 in 10 of the 174 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Audit
Systematic security audit for Electron desktop applications. Identifies vulnerabilities across the privilege boundary, produces a prioritized findings table, and generates an actionable implementation plan.
Usage
/security-audit [scope]Scope (optional): Focus the audit on a specific area instead of running the full checklist.
full(default) — all categoriesurls— URL validation surfaceselectron— Electron security handlersipc— IPC and MCP authenticationcsp— Content Security Policycredentials— Credential storage and OAuthbuild— Build pipeline hardening (fuses, signing)
Philosophy
Defense in depth. Layer protections so no single bypass is catastrophic:
- Validate at every trust boundary (main process, preload, renderer)
- Prefer deny-by-default over allowlisting
- Fix the highest-impact, lowest-effort issues first
- Don't over-engineer — match security investment to actual threat model
Pragmatism over paranoia. Not every theoretical attack justifies a fix:
- Localhost-only timing side-channels are low priority
- Session timeouts on local Unix sockets add complexity for minimal gain
- But cross-platform path bugs that silently bypass auth are critical
Workflow
Phase 1: Reconnaissance
Read the codebase to understand the architecture before auditing.
Files to read first:
CLAUDE.md— project architecture overviewsrc/main/index.ts— main process entry (window creation, protocol handlers, CSP)src/preload/index.ts— context bridge surfacesrc/main/ipc.ts— IPC handler definitionselectron-builder.yml— build configurationpackage.json— dependencies and Electron version
Questions to answer:
- What is the Electron version? (Check for known CVEs)
- Is
sandboxenabled? IscontextIsolationenabled? IsnodeIntegrationdisabled? - What custom protocols are registered?
- What IPC channels exist and what do they accept?
- Are there any HTTP/WebSocket servers running in the main process?
- How are credentials stored?
- What CSP is configured?
Phase 2: Audit Checklist
Run through each category systematically. For each finding, record:
- ID: Sequential identifier (H1, M1, etc.)
- Severity: HIGH, MEDIUM, LOW, INFO
- Finding: What the vulnerability is
- Location: File and line number
- Category: Which group it belongs to
Category 1: URL Validation Surfaces
Untrusted URLs can execute arbitrary code via javascript:, data:, or custom schemes.
Check each surface:
| Surface | What to look for |
setWindowOpenHandler | Does it call shell.openExternal without scheme validation? |
will-navigate handler | Does one exist? Does it restrict to expected origins? |
| Link click handlers | Do CMD+Click or renderer link handlers validate schemes? |
| LLM-generated content | Are links from AI responses rendered with href validation? |
shell.openExternal IPC | Is the IPC handler validating schemes before calling? |
Safe pattern:
const parsed = new URL(url)
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
return // block
}Pitfall: new URL('file:///etc/passwd').origin returns 'null' (string) per URL spec. If comparing origins for file:// URLs, check parsed.protocol explicitly.
Category 2: Electron Security Handlers
Missing handlers leave implicit defaults that are usually permissive.
| Handler | Purpose | Correct behavior |
will-navigate | Block navigation to untrusted origins | Allow only app origin (file:// prod, Vite dev server in dev) |
setPermissionRequestHandler | Control permission grants | Deny all (unless app genuinely needs camera/mic/geo) |
certificate-error | Handle invalid TLS certs | Always callback(false) — never trust bad certs |
setWindowOpenHandler | Control window.open() | Deny action, optionally open in external browser |
Pitfall: certificate-error requires both event.preventDefault() AND callback(false). Missing either one uses the default behavior.
Category 3: IPC & Local Server Authentication
Any HTTP/WebSocket/Unix socket server in the main process is accessible to all local processes.
Check:
- Is there an HTTP server? Does it require authentication?
- Is there a Unix socket? Does it require authentication?
- How is the auth token generated, stored, and transmitted?
- Is the token comparison constant-time (
crypto.timingSafeEqual)? - Is the token file restricted to the owning user (
mode: 0o600)? - Is token cleanup attempted on quit?
Auth token lifecycle pattern:
startup → randomBytes(32) → write to file (0o600) → pass to servers → cleanup on will-quitPitfalls:
- Race condition: If a client (e.g., stdio bridge) sends requests before auth handshake completes, the server may reject them. Wait for auth response before resolving the connection promise.
- Cross-platform paths:
app.getPath('userData')resolves differently per platform. Hardcoding~/Library/Application Support/AppNamebreaks on Linux/Windows and silently bypasses auth. - Token-before-start ordering: Set the auth token before calling
server.start(), or enforce it structurally with a guard instart().
Cross-platform userData paths:
function getUserDataPath(): string {
switch (process.platform) {
case 'darwin':
return path.join(os.homedir(), 'Library', 'Application Support', 'AppName')
case 'win32':
return path.join(process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming'), 'AppName')
default:
return path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'AppName')
}
}Category 4: Custom Protocols & CSP
Custom protocol handlers (protocol.handle) can serve arbitrary filesystem content.
Check:
- What files can the protocol serve? Is it confined to a safe directory?
- Does path normalization prevent traversal (
../../../etc/passwd)? - Is CSP
connect-srclimited to actually-used API endpoints? - Does CSP
img-srcallowhttps:wildcard? (Enables tracking pixels but needed for remote images in documents) - Is
style-src 'unsafe-inline'present? (Often required by editor frameworks like TipTap/ProseMirror)
Safe confinement pattern:
const normalized = normalize(filePath)
if (!normalized.startsWith(homedir() + sep)) {
return new Response('Access denied', { status: 403 })
}Category 5: Credential Storage & OAuth
Check:
- Are credentials stored via
safeStorage/ a credential store abstraction? - Are there any plaintext credentials on disk?
- Does the OAuth flow include a CSRF
stateparameter? - Are credential migration paths consistent (no duplicated logic)?
- Is
.mcp.jsonor similar config with secrets in.gitignore?
CSRF state pattern for OAuth:
const csrfState = randomBytes(16).toString('hex')
const authUrl = oauth2Client.generateAuthUrl({ state: csrfState })
// In callback:
if (url.searchParams.get('state') !== csrfState) { reject('CSRF') }Pitfall: Duplicated migration logic across multiple files. Extract a shared migrateFromLegacyFile(legacyPath, credentialKey) helper.
Category 6: Build Pipeline Hardening
Check:
- Are Electron fuses configured to disable dangerous runtime features?
- Is code signing configured? (Distribution concern, may be out of scope)
- Are
devDependenciesproperly separated fromdependencies?
Fuses to disable in production:
// build/afterPack.js
const { flipFuses, FuseV1Options, FuseVersion } = require('@electron/fuses')
await flipFuses(executablePath, {
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
})Wire into electron-builder.yml with afterPack: build/afterPack.js.
Phase 3: Findings Report
Produce a findings table sorted by severity:
| ID | Severity | Finding | Location | Category |
|----|----------|---------|----------|----------|
| H1 | HIGH | ... | `src/main/index.ts:147` | URL Validation |Phase 4: Implementation Plan
Group findings by blast radius and dependency. Prioritize:
- Smallest changes, highest attacker value (URL validation)
- Missing security handlers (Electron event handlers)
- Protocol and CSP fixes (pairs with handlers)
- IPC authentication (most complex, touches multiple files)
- Credential hygiene (mechanical but touches multiple files)
- Build hardening (build pipeline only, no runtime risk)
For each group, specify:
- Files modified
- What changes
- Verification steps
Phase 5: Verification
After implementation, verify each group:
| Group | Verification |
| URL validation | CMD+Click javascript: link → nothing happens. https:// link → opens browser. |
| Electron handlers | DevTools: location.href = 'https://evil.com' → blocked with console warning. |
| IPC auth | curl http://localhost:<port>/endpoint without token → 401. |
| Protocol confinement | local-file:///etc/hosts in DevTools → 403. |
| Credentials | Existing credentials survive migration. New store/retrieve works. |
| Fuses | ELECTRON_RUN_AS_NODE=1 ./App -e "console.log('hi')" → fails. |
Common Mistakes
Lessons from past audits — check for these proactively:
- Hardcoded macOS paths in cross-platform code.
~/Library/Application Support/only works on macOS. Useapp.getPath('userData')in Electron or replicate the platform logic in non-Electron code. - Resolving connections before auth completes. When adding auth handshakes to existing socket connections, the promise must resolve AFTER the auth response, not after sending the request.
- Non-constant-time token comparison. Use
crypto.timingSafeEqualfor all token/secret comparisons. Requires length pre-check sincetimingSafeEqualthrows on length mismatch. - Dead code after adding guards. If
start()throws without a token, thenif (this.token)inside the request handler is dead code. Remove it or add a comment explaining it's defense-in-depth. - Forgetting to
git fetch originbefore comparing branches. Always fetch before claiming a branch is up to date. - Removing CSP entries without removing the code paths. If you tighten
connect-srcto remove a provider URL, verify no UI path still offers that provider as an option. - Credential migration duplication. If the same "read legacy file → store in new system → delete legacy" pattern appears in multiple places, extract a helper before it diverges.
Output Format
The skill produces three artifacts:
- Findings table — all issues found, with severity, location, and category
- Implementation plan — grouped, ordered, with file lists and verification
- Deferred items — issues intentionally not addressed, with rationale and tracking issue references
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

