RED-174764: electron run as node #5376
Open
+44
−0
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.
What
Disables the
ELECTRON_RUN_AS_NODEfuse to prevent sandbox bypass attacks reported in RED-174764When
ELECTRON_RUN_AS_NODE=1environment variable is set, an attacker with local access could run arbitrary JavaScript using the signed RedisInsight binary, bypassing Electron's sandbox and security controls.This fix adds an
afterPackhook to electron-builder that flips theRunAsNodefuse tofalseduring the build process, following Electron's security recommendations.ELECTRON_RUN_AS_NODE=1 "Redis Insight" -e 'console.log("executed")'runs arbitrary JSTesting
yarn package:prodnpx @electron/fuses read --app "./Redis Insight.app"# macOS ELECTRON_RUN_AS_NODE=1 "./Redis Insight.app/Contents/MacOS/Redis Insight" -e 'console.log("VULNERABLE")' # Should NOT print "VULNERABLE"Note
Hardens the packaged app by flipping Electron fuses during build to block node execution via environment variable.
scripts/afterPack.jsthat uses@electron/fusesto setFuseV1Options.RunAsNode=falseon the packaged binary across macOS/Windows/Linuxelectron-builder.jsonviaafterPackWritten by Cursor Bugbot for commit 9fce0a9. This will update automatically on new commits. Configure here.