Files
rcourtman 2686f0afee Read every forwarded hop for control-plane client IPs
The control plane's audit log and rate limiter took the client address
from the first X-Forwarded-For header line only, and skipped hops that
were not a bare IP. Behind a trusted appending proxy, a client could
send its own header line (the proxy's hop then sits on a second line
that was never read) or rely on a proxy writing ip:port or "unknown"
hops, which were skipped until the walk reached client-written entries.
Either way the client chose its audit IP and could rotate rate-limit
buckets per request.

Apply the rule the main server uses: read every header line as one
list, take the right-most hop that is not a trusted proxy, accept
ip:port and [v6]:port hops, and stop at an unreadable hop and use the
proxy's own address. X-Real-IP stays a fallback only when the proxy
sent no X-Forwarded-For entries.

The shipped provider-hosted Traefik drops client-sent X-Forwarded-For
before appending its own, so that bundle was not affected as shipped.
2026-11-13 23:38:26 +00:00
..