[HIGH] Bind remote debugging to localhost by default - #997
Open
OskarEichler wants to merge 1 commit into
Open
OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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
localhostwhen callers omit the host.0.0.0.0,::, or a specific interface.Security impact
Byebug.start_serverandByebug.start_controlcurrently default their host tonil. On Ruby,TCPServer.new(nil, port)binds the wildcard address (observed as::on macOS), exposing the debugger and control ports on every interface.The debugger protocol has no authentication and accepts commands that execute in the stopped process binding. A developer who enables remote debugging without passing a host can therefore unintentionally give any reachable network peer debugger-level code execution in that process.
A focused reproduction on Ruby 4.0.6 reported:
Verification
localhostto both listeners.0.0.0.0remains unchanged for callers intentionally accepting remote connections.main; this two-line networking-default change added no failures.No new tests were added under the consumer audit's no-new-tests constraint.
Breaking change
Yes, intentional: applications that relied on
Byebug.start_serverorByebug.start_controlwith no host to accept non-loopback connections must now pass an explicit bind address such as0.0.0.0or::. This makes network exposure opt-in.Scope and limitations
This change reduces accidental exposure. It does not add transport authentication or encryption, so explicitly exposed remote-debugging ports must still be protected by host/network controls.