Files
floci/src
Abhigya 5d8546a1ff fix(elbv2): add X-Forwarded headers to ALB requests as AWS does (#7278)
* fix(elbv2): add X-Forwarded headers to ALB requests as AWS does

An ALB forwarded client headers unchanged, so a target never learned the
client address and trusted whatever X-Forwarded-For the client sent. The
routing.http.xff_* attributes were stored but never read.

Apply routing.http.xff_header_processing.mode and
routing.http.xff_client_port.enabled on HTTP, WebSocket and Lambda targets,
and set X-Forwarded-Proto and X-Forwarded-Port from the listener connection.
ModifyLoadBalancerAttributes now rejects invalid values for both attributes.

Keep every line of a repeated request header when proxying, and use the last
value in a Lambda event's headers map, as the ALB guide describes.

Take the HTTP API $context.identity.sourceIp from the TCP connection instead
of the caller's X-Forwarded-For, which let a caller spoof it.

* docs(apigatewayv2): limit the X-Forwarded-For hop note to ALB listeners
2026-11-02 07:32:52 -04:00
..