ForwardAuth middleware leaks X-Forwarded-Port spoofing via untrusted X-Forwarded-Proto when trustForwardHeader=false
traefik
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/traefik/traefik/v2 Go |
|
|
| github.com/traefik/traefik/v3 Go |
|
|
traefik
| Product | Affected | Fixed in |
|---|---|---|
| github.com/traefik/traefik/v2 Go |
|
|
| github.com/traefik/traefik/v3 Go |
|
|
| github.com/traefik/traefik Go |
| No fix yet |
Traefik is an HTTP reverse proxy and load balancer. Prior to v2.11.51, v3.6.22, and v3.7.6, Traefik's ForwardAuth middleware, even when configured with trustForwardHeader: false, derives the X-Forwarded-Port header sent to the authentication service from the original incoming request instead of the sanitized forwarded request. As a result, an unauthenticated remote attacker can inject an X-Forwarded-Proto: https header over a plain HTTP connection and cause Traefik to forward X-Forwarded-Port: 443 to the authentication service, bypassing port-based authorization checks. This issue is fixed in versions v2.11.51, v3.6.22, and v3.7.6.
From the CVE record · GitHub_M
Traefik's ForwardAuth middleware can derive the port sent to an authentication service from an unsanitized incoming header, even when trustForwardHeader is false. An unauthenticated remote attacker can send a crafted header over HTTP to make the service see port 443 and bypass port-based authorization checks.
Operators using Go github.com/traefik/traefik/v2 before 2.11.51, github.com/traefik/traefik/v3 before 3.6.22 or from 3.7.0 before 3.7.6, or github.com/traefik/traefik through 1.7.34 should check their deployments.