hotfix: bind Electron API server to loopback#114
Merged
simonhamp merged 1 commit intoMay 20, 2026
Conversation
SRWieZ
approved these changes
May 20, 2026
simonhamp
approved these changes
May 20, 2026
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.
Summary
This hotfix binds the internal Electron API server to the loopback interface instead of allowing Node to bind on all available interfaces.
Problem
The Electron API server is used for PHP <-> Electron communication and is protected by the
X-NativePHP-Secretheader. However, becauselisten()was called without an explicit host, Node could bind the server to external interfaces depending on the environment.For a desktop app, this internal API should not be reachable from other hosts on the LAN at all.
Changes
127.0.0.1.127.0.0.1bind host.NATIVEPHP_API_URLto use127.0.0.1instead oflocalhost.distoutput.127.0.0.1and not0.0.0.0.Verification
npm run plugin:buildnpm run plugin:testNotes
This does not change the public API. PHP <-> Electron communication continues to use the same port range and secret header, but the server is no longer exposed on external network interfaces.