Repository navigation
fix(web): default to 127.0.0.1 instead of 0.0.0.0 (unauthenticated API) - #483
Open
Firefly0619sec wants to merge 1 commit into
Open
Firefly0619sec wants to merge 1 commit into
Firefly0619sec 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.
Problem
opcode-webbinds to0.0.0.0by default and its HTTP/WebSocket API has no authentication:web_main.rs:#[arg(short = 'H', long, default_value = "0.0.0.0")], buthostwas never passed to the server —web_server.rshard-codedSocketAddr::from(([0, 0, 0, 0], port));allow_origin(Any)with all methods/headers;/api/sessions/execute,/api/sessions/continue,/ws/claude, which drive Claude Code — i.e. anyone on the LAN (or anyone reaching a forwarded port) can execute commands.This is documented as a feature ("access from phone"), but the secure default should be loopback, with an explicit opt-in for LAN exposure.
Change
opcode-webnow defaults to127.0.0.1;--hostargument is actually passed through tocreate_web_server(it was ignored before);--host 0.0.0.0is used, because the API is still unauthenticated.Notes
--host 0.0.0.0still works exactly as before for users who need phone access;