fix(gateway): prevent auth bypass when behind unconfigured reverse proxy#1795
Merged
steipete merged 2 commits intoopenclaw:mainfrom Jan 25, 2026
Merged
Conversation
When proxy headers (X-Forwarded-For, X-Real-IP) are present but gateway.trustedProxies is not configured, the gateway now treats connections as non-local. This prevents a scenario where all proxied requests appear to come from localhost and receive automatic trust. Previously, running behind nginx/Caddy without configuring trustedProxies would cause isLocalClient=true for all external connections, potentially bypassing authentication and auto-approving device pairing. The gateway now logs a warning when this condition is detected, guiding operators to configure trustedProxies for proper client IP detection. Also adds documentation for reverse proxy security configuration.
7410237 to
acffcfc
Compare
Contributor
|
Landed via temp rebase onto main. Thanks @orlyjamie! |
Contributor
Author
4 tasks
rodrigouroz
pushed a commit
to rodrigouroz/openclaw
that referenced
this pull request
Jan 26, 2026
…oxy (openclaw#1795) * fix(gateway): prevent auth bypass when behind unconfigured reverse proxy When proxy headers (X-Forwarded-For, X-Real-IP) are present but gateway.trustedProxies is not configured, the gateway now treats connections as non-local. This prevents a scenario where all proxied requests appear to come from localhost and receive automatic trust. Previously, running behind nginx/Caddy without configuring trustedProxies would cause isLocalClient=true for all external connections, potentially bypassing authentication and auto-approving device pairing. The gateway now logs a warning when this condition is detected, guiding operators to configure trustedProxies for proper client IP detection. Also adds documentation for reverse proxy security configuration. * fix: harden reverse proxy auth (openclaw#1795) (thanks @orlyjamie) --------- Co-authored-by: orlyjamie <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
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.

When running behind a reverse proxy (nginx, Caddy, etc.) without configuring
gateway.trustedProxies, all connections appear to come from localhost due to the proxy's loopback connection. This causedisLocalClient=truefor external requests, potentially bypassing authentication and auto-approving device pairingChanges
trustedProxiesis not configuredtrustedProxiesTesting
Deployed behind nginx without
trustedProxiesconfigured - connections now require proper auth instead of auto-approving.Reference
https://x.com/theonejvo/status/2015401219746128322