Safeguard
Developer Tools•

Electron fuses explained: what to turn off before you ship

Electron fuses are switches in the binary that remove features attackers abuse. Here is what each one does and which to flip for a typical app.

Safeguard Security Team
3 min read

Electron fuses are bits in the Electron binary that you flip at packaging time to disable features your app does not need. Turning off runAsNode and the inspector flags are common first steps. Because the flips happen before code signing, the operating system signature check helps keep them from being reversed.

What a fuse is

A normal Electron binary reads environment variables and command line flags that were designed for development. Some of them can make the packaged app run arbitrary code. A fuse lets you remove that behavior from the shipped executable instead of hoping nobody tries.

The Electron docs describe the current set. Defaults differ, so read them before assuming.

The fuses worth a look

FuseDefaultWhat it controls
runAsNodeEnabledWhether the ELECTRON_RUN_AS_NODE variable is respected
nodeOptionsEnabledWhether NODE_OPTIONS is respected
nodeCliInspectEnabledWhether inspect style flags work
embeddedAsarIntegrityValidationDisabledValidates app.asar when it loads (macOS and Windows)
onlyLoadAppFromAsarDisabledRestricts where the app code may load from
grantFileProtocolExtraPrivilegesEnabledGives file pages extra privileges
cookieEncryptionDisabledEncrypts the on disk cookie store

Several of these are enabled by default, which means a stock build accepts them. If your app never forks itself as a Node process, runAsNode can go off. The docs note that when it is disabled, child_process.fork throws, and they point to utility processes as the replacement.

Flipping them

The usual tool is @electron/fuses. Electron Forge ships a fuses plugin in its templates.

const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses')

flipFuses(
  require('electron'),
  {
    version: FuseVersion.V1,
    [FuseV1Options.RunAsNode]: false
  }
)

To check a built app, the docs give a read command: npx @electron/fuses read --app /path/to/App.app. Add that to your release pipeline and fail the build if a fuse is not in the expected state.

Two cautions

  • Cookie encryption is one way. The docs warn that disabling it later corrupts the cookie store, and on macOS the app must be code signed.
  • Fuses are not a substitute for fixing renderer issues. They reduce what an attacker with local access can do to your binary.

Pair the integrity fuses together. The related post on ASAR integrity explains why one without the other leaves a gap.

Quick check

Do fuses replace code signing?

No. They are flipped before signing and rely on the signature to stay in place. Both are needed.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.