mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-14 07:33:36 +01:00
IP-based middleware rules (OIDC bypass, CIDR allowlist) seem ineffective #97
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @deandre on GitHub (Aug 27, 2025).
Problem Summary
When running GoDoxy in Docker Compose (Orbstack) on macOS, all requests (both local and external) show
RemoteAddras127.0.0.1, making all IP-based middleware rules ineffective for security purposes. This affects OIDC bypass rules, CIDR allowlists, and any other middleware that relies on client IP detection. This occurs whether Cloudflare proxy is enabled or disabled.Environment Details
network_mode: hostSteps to Reproduce
network_mode: hostremote 127.0.0.1 | remote 10.0.0.0/24allow: 127.0.0.1, 10.0.0.0/24RemoteAddr: 127.0.0.1in access log and external users bypass all IP-based restrictionsExpected Behavior
Actual Behavior
RemoteAddr: 127.0.0.1in access logsremote 127.0.0.1matches everyone127.0.0.1matches everyoneEvidence
Access Log Example
config.yaml
Affected Middleware Examples
OIDC Bypass
CIDR Allowlist
I may have misconfigured some thing, but I'm curious if anyone else has run into this?
@yusing commented on GitHub (Aug 27, 2025):
Wow! Thanks for detailed testing like this. Will check it tmr it's already midnight here.
@yusing commented on GitHub (Aug 28, 2025):
Hi, I have just done some checking.
127.0.0.1In your case:
CF-Connecting-IPis not present (since you're doing neither tunnel nor cf proxy).Few more questions:
127.0.0.1ips from the logs?@deandre commented on GitHub (Aug 28, 2025):
On my mobile device, disconnected from VPN and WiFi, I see the same.
I noticed
CF-Connecting-IPwas being dropped from logs, despite keeping it in my access log config.I added the following to my middleware config, and then saw
CF-Connecting-IPbeing written to logs, but the IP didn't change (it's still localhost, and I did switch back to WiFi here).This occurs whether or not the DNS record is proxied (it is proxied, however).
I've got nothing in front of GoDoxy. 🤔 Thank you for looking into this!
@yusing commented on GitHub (Aug 28, 2025):
Ah I missed the point that you're running on macOS...
I don't run docker on macOS, but these are my thoughts:
macOS Docker’s host networking isn’t a true Linux
hostnetwork. Even if docker doesn't complain about it, macOS does not supporthostnetwork.The connection flow would be something like:
User -> macOS -> docker as a middleman -> godoxy
GoDoxy can only see 127.0.0.1 as a result.
You may verify that by running
traefik/whoamiin host network mode on your mac and open it in browser.@yusing commented on GitHub (Aug 28, 2025):
CF-Connecting-IPwill only be available when you use cf proxy or tunnel. If you have visited your sites before when proxy was off, after turning back on you're still likely having direct connections because of DNS caching.@deandre commented on GitHub (Aug 28, 2025):
Indeed the problem is with Orbstack. https://github.com/orbstack/orbstack/issues/710 😅 Sorry for the noise, but thanks again for taking a look!
@yusing commented on GitHub (Aug 28, 2025):
No problem! Let me know if you have any questions. If you need to use those security features without problem, you may build it and run the binary.
@deandre commented on GitHub (Aug 28, 2025):
Two steps ahead of ya — thanks again! 😅