Repository navigation
Set Electron Fuses in the packaged app (#373) - #385
Merged
jtklein-agents merged 1 commit intoNov 26, 2026
Conversation
electron-builder sets six fuses through build.electronFuses: no RunAsNode, no NODE_OPTIONS, no Node inspect flags, cookie encryption on, and the app loads only from an asar that passes integrity validation. A pack test asserts the exact block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jtklein-agents
merged commit Nov 26, 2026
279c601
into
spec/370-electron-build-and-runtime-packages-current
10 of 12 checks passed
5 tasks
jtklein-agents
deleted the
373-set-electron-fuses-in-the-packaged-app
branch
November 26, 2026 22:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #373
Summary
electron-builder writes Electron Fuses into the packaged app. A pack test checks the exact block.
"build": { "afterSign": "./scripts/notarize.js", + "electronFuses": { + "runAsNode": false, + "enableCookieEncryption": true, + "enableNodeOptionsEnvironmentVariable": false, + "enableNodeCliInspectArguments": false, + "enableEmbeddedAsarIntegrityValidation": true, + "onlyLoadAppFromAsar": true + },Evidence
Before: the packaged app sets no fuses.
ELECTRON_RUN_AS_NODE,NODE_OPTIONSand--inspectall work on it, and it loads an uncheckedapp.asar.After:
yarn dist-pack, thennpx @electron/fuses read --app dist/mac-arm64/raxmlGUI.app(macOS arm64):The packed app ran for 20 s with no errors until it was stopped.
New test in
src/pack.test.ts:expect( build.electronFuses ).toEqual( { …the six fuses… } )fails if a fuse is added, dropped or changed.yarn test475/475, app e2e 4/4 (still launchesout/main/index.json the dev Electron, which has no fuses), lint and typecheck clean on macOS. Ubuntu and Windows are covered by CI only.Not covered: the repo has no
yarn verifyscript, so lint + typecheck +yarn teststand in for it. No CI job packs the app or reads its fuses. A fused Windows, Linux or universal-mac build has not been launched; the parent spec leaves that to the release-candidate check.Merge Danger
Door: two-way
Removing the block brings back the unfused build. An app a user has already installed keeps its fuses until it updates.
Blast Radius: packaged-app startup
If
onlyLoadAppFromAsaror the asar integrity check doesn't hold on some platform's packed build, that build won't start. Dev runs and e2e are unaffected.🤖 Generated with Claude Code