Summary
A protocol-handling flaw in Traefik can allow a client-controlled HTTP/2 cleartext upgrade to create a raw tunnel to a shared backend. If that backend accepts the upgrade, later requests may bypass Traefik routing and security controls, allowing unauthenticated access to protected backend paths.
Affected context
The vulnerability affects Traefik deployments that proxy traffic to a shared backend capable of accepting h2c upgrades. It becomes risky when client-supplied upgrade-related headers are forwarded, the backend responds with 101 Switching Protocols, and protected and unprotected routes share the same backend connection context. After the tunnel is established, Traefik may no longer apply routing, authentication, authorization, rate limiting, observability, or related middleware to subsequent HTTP/2 requests.
Exploit preconditions
- Attack surface: An HTTP-facing Traefik reverse-proxy entry point
- Required access: Ability to send unauthenticated requests to an exposed route
- Trigger point: Processing of a client-requested h2c upgrade to a backend
- Backend condition: The selected backend accepts the upgrade and returns
101 Switching Protocols - Why exploitation is possible: Traefik transitions into a raw tunnel and stops applying request-level routers and middleware to later traffic
Why this happens
The underlying issue is inconsistent protocol and request-boundary handling between Traefik and an h2c-capable backend. Client-controlled upgrade headers can cause Traefik to switch from normal HTTP routing into a raw tunnel, even though later requests still reach resources that would ordinarily require middleware enforcement.
This maps primarily to CWE-444: Inconsistent Interpretation of HTTP Requests, because the proxy and backend do not maintain equivalent security-relevant interpretations of the connection. It also relates to CWE-863: Incorrect Authorization, because protected resources can become reachable without the intended authorization checks.
Potential impact
- An unauthenticated user may reach protected backend paths
- Authentication and authorization middleware may be bypassed
- Rate limiting and IP-based access controls may no longer apply
- Access logging, metrics, and tracing may omit tunneled requests
- Sensitive backend data may be disclosed or modified
- Backend actions could be performed outside expected policy boundaries
General mitigation guidance
Mitigation generally focuses on preventing untrusted clients from forcing protocol transitions that bypass proxy policy enforcement.
Common defensive patterns include:
- Rejecting or tightly controlling client-supplied connection-upgrade headers at trust boundaries
- Disabling h2c exposure unless it is explicitly required and safely isolated
- Ensuring upgraded or tunneled connections cannot reach resources requiring HTTP-level middleware
- Separating public and protected services or backend connection pools
- Applying authentication and authorization controls at the backend as a defense in depth
- Running backend services with least privilege and limiting their reachable resources
- Preserving security-relevant audit coverage for upgraded connections
- Using maintained Traefik releases that contain the vendor's corrective changes, according to organizational change-control procedures
How teams detect issues like this
Organizations can identify this class of issue through:
- Static and dynamic tests for forwarding of
Connection,Upgrade, andHTTP2-Settingsheaders - Integration tests covering h2c upgrades,
101 Switching Protocols, and subsequent HTTP/2 requests - Code review checks for transitions from routed HTTP handling to raw tunnel processing
- Proxy configuration reviews that identify shared backends for public and protected routes
- Monitoring for unexpected upgrade responses, long-lived tunnels, and protected-resource access without authentication events
- Policy enforcement that blocks unsupported protocol upgrades at ingress boundaries
- Automated security testing or neutral code-review tools that model middleware behavior after protocol transitions

