Envoy xff_num_trusted_hops requires a verified proxy topology to pick the client address
Envoy's original IP detection can derive a client address from X-Forwarded-For, with xff_num_trusted_hops setting how many right-side proxy hops to trust. Per the documentation, with use_remote_address false and N greater than zero, the trusted address is the (N+1)th address from the right. Misreading the counting direction or copying a hop count from another environment can make access rules or rate limits depend on attacker-controlled header values. The count must be updated whenever the topology changes, such as adding a load balancer, ingress layer, or sidecar, and it must be coordinated with use_remote_address across listeners. Teams should map every component that reads or modifies the header, then test with forged headers to confirm which address Envoy selects. Where possible, a single trusted ingress path should overwrite the header and network policy should block bypass routes.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in