CVE-2026-39858
JSON

7.8high

Traefik: Forwarded alias spoofing top pre-auth decision bypass

Severity
7.8high CVSS:4.0 by GitHub_M
Exploit likelihood
0.60% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-5m6w-wvh7-57vmGO-2026-5149

Description

Traefik is an HTTP reverse proxy and load balancer. Prior to versions 2.11.43, 3.6.14, and 3.7.0-rc.2, there is a high severity authentication bypass vulnerability in Traefik's ForwardAuth and snippet-based authentication middleware. Traefik's forwarded-header sanitization logic targets only canonical header names (e.g., X-Forwarded-Proto) and does not strip or normalize alias variants that use underscores instead of dashes (e.g., X_Forwarded_Proto). These unsanitized alias headers are forwarded intact to the authentication backend. When the backend normalizes underscore and dash header forms equivalently, an attacker can inject spoofed trust context — such as a trusted scheme or host — through the alias headers and bypass authentication on protected routes without valid credentials. This issue has been patched in versions 2.11.43, 3.6.14, and 3.7.0-rc.2.

Affected

Product or packageVersionsReported by
traefik traefik< 2.11.43, >= 3.0.0-beta1, < 3.6.14, >= 3.7.0-ea.1, < 3.7.0-rc.2, before 2.11.43, from 3.0.0 before 3.6.14, 3.7.0CVE List, NVD
devspaces/traefik-rhel9Not specified
Not affected: from 1779786779 before *
CVE List
github.com/traefik/traefik/v3 (Go)from 3.7.0-ea.1 before 3.7.0-rc.2, from 3.0.0-beta1 before 3.6.14, before 3.6.14GitHub Advisory Database, Go Vulnerability Database
github.com/traefik/traefik/v2 (Go)before 2.11.43GitHub Advisory Database, Go Vulnerability Database
github.com/traefik/traefik (Go)up to 1.7.34, all versionsGitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M7.8high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
redhat-SADP8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
GitHub10.0high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N
NVD10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

Classification

CWE-289CWE-290CWE-306

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Traefik is an HTTP reverse proxy and load balancer. Prior to versions 2.11.43, 3.6.14, and 3.7.0-rc.2, there is a high severity authentication bypass vulnerability in Traefik's ForwardAuth and snippet-based authentication middleware. Traefik's forwarded-header sanitization logic targets only canonical header names (e.g., X-Forwarded-Proto) and does not strip or normalize alias variants that use underscores instead of dashes (e.g., X_Forwarded_Proto). These unsanitized alias headers are forwarded intact to the authentication backend. When the backend normalizes underscore and dash header forms equivalently, an attacker can inject spoofed trust context — such as a trusted scheme or host — through the alias headers and bypass authentication on protected routes without valid credentials. This issue has been patched in versions 2.11.43, 3.6.14, and 3.7.0-rc.2.

GitHub Advisory Database

Summary

There is a high severity authentication bypass vulnerability in Traefik's ForwardAuth and snippet-based authentication middleware. Traefik's forwarded-header sanitization logic targets only canonical header names (e.g., X-Forwarded-Proto) and does not strip or normalize alias variants that use underscores instead of dashes (e.g., X_Forwarded_Proto). These unsanitized alias headers are forwarded intact to the authentication backend. When the backend normalizes underscore and dash header forms equivalently, an attacker can inject spoofed trust context — such as a trusted scheme or host — through the alias headers and bypass authentication on protected routes without valid credentials.

Patches

For more information

If there are any questions or comments about this advisory, please open an issue.

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

An authentication bypass arises from chaining two bugs: incomplete forwarded-header sanitization at ingress and overly permissive header forwarding in pre-auth subrequests. While canonical X-Forwarded-* headers are handled, alias variants (e.g., underscore forms) are neither normalized nor stripped consistently. When downstream auth services normalize these headers, attackers can inject trusted context and bypass authentication on protected routes without credentials.

Details

This issue results from the interaction between forwarded-header handling and auth subrequest construction, creating a trust boundary mismatch.

At ingress, Traefik defines a fixed set of canonical forwarded headers (X-Forwarded-Proto, X-Forwarded-For, etc.):

Reference : pkg/middlewares/forwardedheaders/forwarded_header.go#L29-L36

var xHeaders = []string{
	xForwardedProto,
	xForwardedFor,
	xForwardedHost,
	xForwardedPort,

This logic focuses exclusively on canonical header names and does not account for alias forms such as X_Forwarded_Proto. As a result, while standard headers may be sanitized or rewritten, semantically equivalent variants can pass through unchanged.

During ForwardAuth processing, request headers are copied wholesale into the auth subrequest:

Reference : pkg/middlewares/auth/forward.go#L401-L408

utils.CopyHeaders(forwardReq.Header, req.Header)
RemoveConnectionHeaders(forwardReq)
utils.RemoveHeaders(forwardReq.Header, hopHeaders...)

This implementation forwards nearly all client-supplied headers to the auth backend, with filtering limited to hop-by-hop headers. There is no normalization or deduplication between canonical and alias header forms, meaning attacker-controlled headers can reach the auth service intact.

A similar pattern exists in snippet-based auth:

Reference : pkg/middlewares/ingressnginx/snippet/snippet.go#L574-L581

utils.CopyHeaders(forwardReq.Header, req.Header)
RemoveConnectionHeaders(forwardReq)
utils.RemoveHeaders(forwardReq.Header, hopHeaders...)

Again, headers are forwarded without enforcing a consistent trust model or canonicalization.

The vulnerability emerges when the auth backend normalizes header names (e.g., treating X_Forwarded_Proto and X-Forwarded-Proto equivalently). In that case:

  • Traefik sanitizes only canonical headers.
  • Alias headers remain attacker-controlled.
  • The auth service merges or evaluates these aliases during normalization.
  • Trust predicates (e.g., scheme = HTTPS, trusted host) are satisfied using spoofed values.

This allows a single crafted request to simultaneously bypass ingress trust enforcement and satisfy authentication checks, resulting in unauthorized access to protected backends.

PoC
  1. Configure a protected route using ForwardAuth or snippet-based auth, with an auth backend that normalizes header names (underscore ↔ dash).
  2. Send a control request (expected: denied):
GET / HTTP/1.1
Host: target.local
User-Agent: poc-control
Connection: close
  1. Send an exploit request with alias headers (expected: allowed):
GET /protected HTTP/1.1
Host: app.example.local
X_Forwarded_Proto: https
X_Forwarded_Host: trusted.example
Connection: close
Impact

This vulnerability allows unauthenticated attackers to bypass authentication at the proxy-to-auth boundary by injecting spoofed trust context through header aliases. In deployments where authorization decisions depend on forwarded headers, attackers can access protected endpoints and interact with backend services as if they were fully authenticated. This effectively undermines ForwardAuth and similar mechanisms, potentially exposing sensitive internal functionality and data.

Suggested Remediation
  1. Strip and regenerate both canonical and alias forms of forwarded headers consistently at ingress and during auth subrequests.
  2. Apply a unified normalization policy across all forwarded header families (including RFC7239 and X-Forwarded-*).
  3. Restrict which headers are forwarded to auth services (prefer explicit allowlists).
  4. Add regression tests covering alias normalization inconsistencies across common backend frameworks.
</details>
Go Vulnerability Database

Traefik: Pre-authentication decision bypass due to forwarded alias spoofing in github.com/traefik/traefik.

NOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.

(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)

The additional affected modules and versions are: .

NVD (es)

Traefik es un proxy inverso HTTP y un balanceador de carga. Antes de las versiones 2.11.43, 3.6.14 y 3.7.0-rc.2, existe una vulnerabilidad de omisión de autenticación de alta gravedad en el middleware de autenticación ForwardAuth y basado en snippets de Traefik. La lógica de saneamiento de encabezados reenviados de Traefik se dirige solo a nombres de encabezado canónicos (por ejemplo, X-Forwarded-Proto) y no elimina ni normaliza variantes de alias que usan guiones bajos en lugar de guiones (por ejemplo, X_Forwarded_Proto). Estos encabezados de alias no saneados se reenvían intactos al backend de autenticación. Cuando el backend normaliza las formas de encabezado con guiones bajos y guiones de manera equivalente, un atacante puede inyectar contexto de confianza falsificado - como un esquema o host de confianza - a través de los encabezados de alias y omitir la autenticación en rutas protegidas sin credenciales válidas. Este problema ha sido parcheado en las versiones 2.11.43, 3.6.14 y 3.7.0-rc.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-39858 changed 2026-07-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-5m6w-wvh7-57vm changed 2026-06-25CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5149 changed 2026-11-23CC-BY-4.0
NVDCVE-2026-39858 changed 2026-11-11Public domain