fix(gateway): require loopback proxy IP for trusted-proxy + bind=loopback#22082
Merged
fix(gateway): require loopback proxy IP for trusted-proxy + bind=loopback#22082
Conversation
Contributor
Author
rodrigogs
pushed a commit
to rodrigogs/openclaw
that referenced
this pull request
Feb 20, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
Hansen1018
added a commit
to Hansen1018/openclaw
that referenced
this pull request
Feb 21, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
dgarson
pushed a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 21, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
mmyyfirstb
pushed a commit
to mmyyfirstb/openclaw
that referenced
this pull request
Feb 21, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
obviyus
pushed a commit
to guirguispierre/openclaw
that referenced
this pull request
Feb 22, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
6 tasks
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…back (openclaw#22082) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 6ff3ca9 Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com> Reviewed-by: @mbelinky
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
After #20097,
auth.mode=trusted-proxy+bind=loopbackis allowed (good), but misconfiguredgateway.trustedProxiesvalues (for example only10.0.0.1) can still make auth fail in confusing ways for same-host proxy setups.Fix
auth.mode=trusted-proxyand resolved bind is loopback, requiregateway.trustedProxiesto include a loopback proxy address (127.0.0.1,::1, or loopback CIDR).::1(allowed)Verification
pnpm vitest run src/gateway/server-runtime-config.test.tsFollow-up hardening for #20097.
Greptile Summary
Adds runtime validation to prevent misconfigured
gateway.trustedProxiesfrom breaking auth in same-host proxy setups. Whenbind=loopbackandauth.mode=trusted-proxy, the gateway now requires at least one loopback address (127.0.0.1,::1, or a loopback CIDR) in the trusted proxy list.The implementation leverages existing
isTrustedProxyAddressCIDR-matching logic and includes comprehensive test coverage for both IPv4 and IPv6 loopback addresses, as well as rejection cases. Documentation correctly reflects the new requirement with clear guidance for same-host proxy configurations.Confidence Score: 5/5
isTrustedProxyAddress, includes comprehensive test coverage for both acceptance and rejection paths (covering127.0.0.1,::1, non-loopback addresses, and empty proxy lists), and follows the existing validation pattern. Documentation is properly updated to reflect the new requirement.Last reviewed commit: 7cdbb65