Traefik before v2.11.52 Authentication Bypass via ReplacePathRegex
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 versions <= v2.11.51, >= v3.6.0 <= v3.6.22, and >= v3.7.0 <= v3.7.6 contain an authentication bypass via path traversal in the ReplacePathRegex middleware. When ReplacePathRegex is configured with a regex that captures user-controlled path segments without a mandatory path separator (e.g. regex "^/api(.*)", replacement "/$1"), the middleware forwards the replaced path to the backend without validating that it matches its normalized form. An unauthenticated remote attacker can send a crafted request (e.g. GET /api../admin) that produces an un-normalized path such as /../admin, which a backend that normalizes paths resolves to a protected route, bypassing authentication middleware. Fixed in v2.11.52, v3.6.23, and v3.7.7.
From the CVE record · VulnCheck
Traefik’s ReplacePathRegex middleware can forward an unnormalized path when its regex captures user-controlled path segments without a mandatory path separator. An unauthenticated remote attacker can use a crafted request to reach a protected backend route if the backend normalizes paths.
Check Traefik deployments using Go package github.com/traefik/traefik/v2 before 2.11.52, github.com/traefik/traefik/v3 from 3.6.0 through 3.6.22 or from 3.7.0 through 3.7.6, or github.com/traefik/traefik through 1.7.34.