Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    electron surface audit

    1

    Audit any Electron app straight from disk: fuse state out of the binary, ASAR integrity, and 20 code rules for the flags that turn a renderer bug into code execution. Two seconds, no window, no network.

    Free

    1 useSecurity scanned
    electron surface audit

    electron surface audit

    Example session with this skill installed

    python scripts/audit.py "C:\Program Files\SomeApp\SomeApp.exe" --fail-on high

    • Read your context and instructions
    • Compiled the electron surface audit

    target C:\Program Files\SomeApp\SomeApp.exe
    exe C:\Program Files\SomeApp\SomeApp.exe
    asar C:\Program Files\SomeApp\resources\app.asar

    score 21/100 grade F (critical)
    fuse penalty 117, code penalty 23

    FUSES
    [RISK] Run as Node enabled safe=disabled
    [RISK] Cookie encryption disabled safe=enabled
    [RISK] NODE_OPTIONS support enabled safe=disabled
    [RISK] --inspect arguments enabled safe=disabled
    [RISK] Embedded ASAR integrity disabled safe=enabled
    [RISK] Only load app from ASAR disabled safe=enabled
    [RISK] Browser-specific V8 snapshot disabled safe=enabled
    [RISK] file:// extra privileges enabled safe=disabled
    [ ok ] WASM trap handlers enabled safe=enabled

    FINDINGS
    [high ] ES-011 shell.openExternal called with a non-literal argument
    at lib/main.js:10044

                 } else await shell.openExternal(url);
                 fix: Parse with new URL(), allow only http(s), compare the host
    
                  against an allowlist, and reject everything else.
    

    [high ] ES-018 Auto-updater trusts an unsigned feed
    at updater.js:88
    updater.setFeedURL = function(url){
    fix: Use a provider with signed manifests, pin the signing key, and
    verify the downloaded artifact before it is applied.

    COVERAGE LIMITS

    • Scanned 120 of 467 candidate script files (caps: 120 files / 32 MB).
      Raise --max-files or pass --include-deps to cover more.

    exit code 1

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Your Electron app is one boolean away from remote code execution

    Not a metaphor. This is the whole attack:

    webPreferences: { nodeIntegration: true }   // someone added this in 2019
    

    A page renders. Something gets a script into it — a third-party widget, an XSS in a bundled UI library, an injected proxy response. That script now calls require('child_process').exec() with your user's permissions.

    No memory corruption. No sandbox escape. No exploit chain. One configuration line, plus anything that achieves script execution.

    And you cannot see it from outside. The installer is signed. The icon is polished. The app runs normally. The only way to know is to read the binary and the archive.

    What this does

    electron-surface-audit reads three things off disk and reports what an attacker would use first.

    1. Fuses — the switchboard compiled into the executable. Electron embeds nine compile-time switches in the binary, at a sentinel-delimited table. They are not in your source code, not in package.json, and there is no API to read them. This tool locates the table, decodes the positional state array, and compares each fuse against its safe value.

    RunAsNode: enabled means ELECTRON_RUN_AS_NODE=1 your-app.exe turns your signed application into a Node interpreter, carrying your bundle identity — and on macOS, your TCC permissions. OnlyLoadAppFromAsar: disabled means a loose app/ directory dropped next to the archive wins at launch.

    2. ASAR integrity. Which archive the executable will actually load, and whether it is the one you signed. If a live app.asar is gone and only app.asar.bak remains, the report says which file it audited instead of pretending.

    3. Application code — 20 rules over your own JavaScript and HTML.

    idseveritycatches
    ES-001criticalnodeIntegration: true
    ES-002criticalcontextIsolation: false
    ES-003highsandbox: false
    ES-004criticalwebSecurity: false
    ES-005highallowRunningInsecureContent: true
    ES-006mediumexperimentalFeatures: true
    ES-007mediumenableBlinkFeatures
    ES-008highremote content over plain HTTP
    ES-009highremote content in a privileged window
    ES-010mediumno Content-Security-Policy
    ES-011highshell.openExternal with an unguarded argument
    ES-012highipcMain handler with no sender validation
    ES-013medium<webview> enabled
    ES-014mediumwindow-open handler returns allow
    ES-015mediumno will-navigate guard
    ES-016highpreload exposes a raw module
    ES-017mediumno permission request handler
    ES-018highupdater trusts an unsigned feed
    ES-019mediumremote module
    ES-020lowDevTools opened unconditionally

    Comments are stripped before matching, so documentation and commented-out examples stay quiet. node_modules is excluded by default — the audit is about the code you maintain, and telling you to patch a dependency's defaults is not actionable.

    Example session

    $ python scripts/audit.py "C:\Program Files\SomeApp\SomeApp.exe"
    
    target   C:\Program Files\SomeApp\SomeApp.exe
    asar     C:\Program Files\SomeApp\resources\app.asar
    
    score    21/100   grade F (critical)
             fuse penalty 117, code penalty 23
    
    FUSES
      [RISK] Run as Node                        enabled   safe=disabled
      [RISK] Cookie encryption                  disabled  safe=enabled
      [RISK] NODE_OPTIONS support               enabled   safe=disabled
      [RISK] --inspect arguments                enabled   safe=disabled
      [RISK] Embedded ASAR integrity            disabled  safe=enabled
      [RISK] Only load app from ASAR            disabled  safe=enabled
      [RISK] file:// extra privileges           enabled   safe=disabled
      [ ok ] WASM trap handlers                 enabled   safe=enabled
    
    FINDINGS
      [high    ] ES-011  shell.openExternal called with a non-literal argument
                 at lib/main.js:10044
                 } else await shell.openExternal(url);
                 fix: Parse with new URL(), allow only http(s), compare the host
                      against an allowlist, and reject everything else.
    

    Two real reports ship in references/examples/ — a 2019-era note app at 27/100 with three live nodeIntegration: true sites, and a current AI desktop client at 21/100 with eight fuse risks. Neither vendor advertises these.

    Three decisions that make the number usable

    not assessed is not 100. When neither a fuse table nor an application archive can be read, the tool prints not assessed. A launcher stub and a hardened app must not look the same. Most scanners get this wrong and call an unreadable target clean.

    Exponential scoring, critical cap. Linear subtraction puts a three-finding legacy app and a twenty-finding modern app both at zero, and the number stops discriminating. Here score = 100 · e^(−penalty/90), capped at 65 whenever a critical exists.

    Guards suppress noise, and the suppression is recorded. ES-011 checks the statement and the four lines above it for new URL(), a protocol === 'https:' comparison, or an allowlist. If the guard is present, the finding is suppressed — and listed in the JSON as suppressed, with the reason. You can audit the auditor.

    Why this beats prompting it yourself

    You can ask a model "is this Electron app secure?" It will answer confidently. It cannot:

    • Read the fuse state of a compiled binary. No API. The bytes are at a sentinel table inside the .exe. Reading them means locating the sentinel, decoding a positional array, and knowing what each of nine values means for exploitability. A model reading your source never sees this layer at all.
    • Know which archive will load. resources/app.asar, resources/app/*.asar, a .bak that outlived the live file — the resolution order matters, and a wrong guess audits the wrong program.
    • Tell "not found" from "not there". "No setPermissionRequestHandler anywhere" means one thing across 14 files and another across 120 of 9,904. The tool tracks scan completeness and marks each absence finding partial_evidence: true when it truncated.
    • Produce something reproducible. A report with file:line citations can go into a code review, be diffed between releases, and gate CI with --fail-on high. A chat transcript cannot.

    Use cases

    • Pre-release review. Run it in CI on the packaged artifact, not the source tree. --fail-on high fails the build.
    • Dependency triage. You downloaded a desktop tool and want to know what it can do to your machine before running it.
    • Vendor conversations. "Your build has RunAsNode enabled and OnlyLoadAppFromAsar disabled" is a specific, checkable claim. "Feels insecure" is not.
    • Teaching. Every finding carries the Electron checklist item it comes from, so the recommendation is checkable rather than asserted.

    Install

    Zero dependencies. Python 3.8+, standard library only.

    python scripts/audit.py --help
    python scripts/audit.py "C:\Program Files\SomeApp\SomeApp.exe"
    python scripts/audit.py ./SomeApp.app --json --markdown audit.md
    python scripts/audit.py ./resources/app.asar --fail-on high
    

    Exit codes: 0 clean at threshold, 1 findings, 2 target unreadable.

    As an Agent Skill: drop the directory into your skills folder. The SKILL.md frontmatter tells the agent when to reach for it.

    Known limitations, stated plainly

    • Static only. The target is never launched. Runtime decisions — which URL a window actually loaded, what the preload actually exposed, whether the server sent a CSP — are outside what bytes can tell you.
    • No data-flow analysis. openExternal(x) where x was validated three functions away is still reported. Treat those as "needs a human look", not proof of a bug.
    • Absence checks depend on scope. ES-010, ES-015, ES-017 fire on not-found. When --max-files truncated the scan, each is marked partial_evidence: true.
    • Pre-fuse builds. Electron < 12 has no fuse table. That is a finding about the Electron version, not a pass.
    • One app per run. No runtime, server, or plugin-host auditing.

    Re-run after each fix. The score is a progress indicator, not a target — going from 21 to 60 by deleting rules would be a worse app, not a better one.

    What's inside

    scripts/
      audit.py       entry point, scoring, text + Markdown rendering   472 lines
      fuses.py       fuse table locator and decoder                    127 lines
      fuse_map.py    the nine fuses: id, safe state, severity, why      157 lines
      asar.py        ASAR reader (header anchor, member extraction)     173 lines
      rules.py       20 rules with guards and absence checks            409 lines
    references/
      checklist.md   the reasoning behind every rule
      examples/      two real reports from shipped applications
    

    MIT licensed. The checklist it implements is Electron's own, publicly maintained at electronjs.org/docs/latest/tutorial/security. esa-logo.png

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.

    Static analysis only; no runtime or data-flow state. Requires Electron 12+ for fuse decoding. Does not verify code signing signatures, only integrity flags.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 10 days ago

    • Free with an Agensi account

    Software
    Python 3.8+ (standard library only)Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Network Access
    Environment Variables
    Listed10 days ago

    What's inside

    Frequently Asked Questions

    No, the audit is entirely passive. It reads the bytes of the executable and archives directly from disk, meaning you can safely analyze suspicious or third-party applications without the risk of them executing code on your machine.

    While generic models often hallucinate security flags, this skill performs bit-level inspection of the binary's 'fuses.' It detects hardcoded engine-level configurations, like RunAsNode, which are invisible to standard source code scanners or general LLM prompts.

    The skill accepts standard Electron distribution formats, including Windows executables (.exe), macOS app bundles (.app), and cross-platform archive files (.asar). It is designed to work with any Electron version that utilizes the modern Fuses API.

    You will receive the core Python-based analysis engine, including the fuse decoder, ASAR integrity checker, and the static analysis suite. It also includes reporting templates for both Markdown and JSON formats to support manual reviews or automated CI/CD workflows.

    The skill is excellent at identifying configuration-based vulnerabilities like 'nodeIntegration' or missing 'contextIsolation.' However, it cannot detect runtime-only issues such as server-side CSP headers or dynamic logic that only triggers during execution.

    New in Code Quality & Review

    Free