Skip to content

Comments

fix(gateway): prevent auth bypass when behind unconfigured reverse proxy#1795

Merged
steipete merged 2 commits intoopenclaw:mainfrom
orlyjamie:fix/proxy-auth-bypass-warning
Jan 25, 2026
Merged

fix(gateway): prevent auth bypass when behind unconfigured reverse proxy#1795
steipete merged 2 commits intoopenclaw:mainfrom
orlyjamie:fix/proxy-auth-bypass-warning

Conversation

@orlyjamie
Copy link
Contributor

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 caused isLocalClient=true for external requests, potentially bypassing authentication and auto-approving device pairing

Changes

  • Detect when proxy headers exist but trustedProxies is not configured
  • In this case, don't treat the connection as local (fail secure)
  • Log a warning guiding operators to configure trustedProxies
  • Add documentation for reverse proxy security configuration

Testing

Deployed behind nginx without trustedProxies configured - connections now require proper auth instead of auto-approving.

Reference
https://x.com/theonejvo/status/2015401219746128322

orlyjamie and others added 2 commits January 25, 2026 15:07
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.
@steipete steipete force-pushed the fix/proxy-auth-bypass-warning branch from 7410237 to acffcfc Compare January 25, 2026 15:07
@steipete steipete merged commit 6aec34b into openclaw:main Jan 25, 2026
21 of 22 checks passed
@steipete
Copy link
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: acffcfc
  • Merge commit: 6aec34b

Thanks @orlyjamie!

@orlyjamie
Copy link
Contributor Author

image

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants