fix(security): reject non-loopback Daemon.Host in Local exposure mode#901
Merged
Aaronontheweb merged 2 commits intoMay 6, 2026
Merged
Conversation
…netclaw-dev#900) ExposureMode.Local now requires binding to a loopback address (127.0.0.1, ::1, or localhost). Non-loopback hosts are rejected at daemon startup and surfaced as errors by netclaw doctor. Users who need a non-loopback bind must set an explicit ExposureMode.
Docker CI smoke test now probes health from inside the container via docker exec instead of host port mapping, letting the daemon bind loopback in Local mode. README Docker quickstart updated to include ExposureMode=reverse-proxy and TrustedProxies for non-loopback binds.
d12f7ed to
acbf13a
Compare
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
ExposureMode.Localnow rejects non-loopbackDaemon.Hostvalues at daemon startup and vianetclaw doctor(upgraded from warning to hard error)DaemonExposureValidator.GetLoopbackViolationIssue()helper to keep message strings in one place, matching the existingGetMissingRequiredProcessIssue()patternExposureMode(reverse-proxy, tailscale-serve, etc.)Closes #900
Related: #189 (closed), #866, #868
Test plan
Validator_rejects_non_loopback_host_in_local_mode— 0.0.0.0, 10.0.0.5, 192.168.1.100 all produce validation issuesValidator_accepts_loopback_host_in_local_mode— 127.0.0.1, ::1, localhost pass cleanLocal_NonLoopbackHost_Throws— startup service aborts withInvalidOperationExceptionLocal_LoopbackHost_SkipsAllValidation— default config still starts fineLocal_NonLoopbackHost_IsError/Local_WithPrivateIp_IsError— doctor surfaces error severity