CVE-2026-39858: Traefik Pre-authentication Decision Bypass Due To Vulnerability
HIGHCVE-2026-39858 is a HIGH (CVSS 10.0) pre-authentication decision bypass due to vulnerability (CWE-306: Missing Authentication for Critical Function) affecting Traefik libraries in the Go ecosystem. The issue involves pre-authentication decision bypass due to forwarded alias spoofing. Remediation is available by upgrading affected packages to version 3.7.0-rc.2, 3.6.14, 2.11.43.
CVE-2026-39858 at a Glance
Security Impact
CVSS: 10.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2026-39858
To remediate this vulnerability, upgrade all affected Traefik dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/traefik/traefik/v3 to 3.7.0-rc.2
Upgrade github.com/traefik/traefik/v3 to 3.6.14
Upgrade github.com/traefik/traefik/v2 to 2.11.43
Upgrade github.com/traefik/traefik to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/traefik/traefik/v3
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-39858, inspect your project dependencies for Traefik:
inspect dependencies for github.com/traefik/traefik/v3
Analyze the terminal output to locate any version of Traefik in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.0-rc.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. In Traefik, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-39858 Affected Traefik Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/traefik/traefik/v3
|
Go |
≥ 3.7.0-ea.1
< 3.7.0-rc.2
|
3.7.0-rc.2
|
|
github.com/traefik/traefik/v3
|
Go |
≥ 3.0.0-beta1
< 3.6.14
|
3.6.14
|
|
github.com/traefik/traefik/v2
|
Go |
< 2.11.43
|
2.11.43
|
|
github.com/traefik/traefik
|
Go |
≤ 1.7.34
|
|
References
Frequently Asked Questions
What is CVE-2026-39858?
Which Traefik versions are affected?
What version fixes CVE-2026-39858?
Is github.com/traefik/traefik/v3 affected?
Is github.com/traefik/traefik/v2 affected?
What is the CVSS score of CVE-2026-39858?
What CWE is associated with CVE-2026-39858?
How can I check Go dependencies for CVE-2026-39858?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5m6w-wvh7-57vm",
"modified" : "2026-05-06T21:24:39Z",
"published" : "2026-04-24T16:32:34Z",
"aliases" : [ "CVE-2026-39858" ],
"summary" : "Traefik: Pre-authentication decision bypass due to forwarded alias spoofing",
"details" : "## Summary\n\nThere 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.\n\n## Patches\n\n- https://github.com/traefik/traefik/releases/tag/v2.11.43\n- https://github.com/traefik/traefik/releases/tag/v3.6.14\n- https://github.com/traefik/traefik/releases/tag/v3.7.0-rc.2\n\n## For more information\n\nIf there are any questions or comments about this advisory, please [open an issue](https://github.com/traefik/traefik/issues).\n\n<details>\n<summary>Original Description</summary>\n\n### Summary\nAn 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.\n\n### Details\nThis issue results from the interaction between forwarded-header handling and auth subrequest construction, creating a trust boundary mismatch.\n\nAt ingress, Traefik defines a fixed set of canonical forwarded headers (`X-Forwarded-Proto`, `X-Forwarded-For`, etc.):\n\nReference : [`pkg/middlewares/forwardedheaders/forwarded_header.go#L29-L36`](https://github.com/traefik/traefik/blob/174e5d81111d8e9fb3d3c81cf6d22f3e33eb4f78/pkg/middlewares/forwardedheaders/forwarded_header.go#L29-L36)\n\n```go\nvar xHeaders = []string{\n\txForwardedProto,\n\txForwardedFor,\n\txForwardedHost,\n\txForwardedPort,\n```\n\nThis 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.\n\nDuring ForwardAuth processing, request headers are copied wholesale into the auth subrequest:\n\nReference : [`pkg/middlewares/auth/forward.go#L401-L408`](https://github.com/traefik/traefik/blob/174e5d81111d8e9fb3d3c81cf6d22f3e33eb4f78/pkg/middlewares/auth/forward.go#L401-L408)\n\n```go\nutils.CopyHeaders(forwardReq.Header, req.Header)\nRemoveConnectionHeaders(forwardReq)\nutils.RemoveHeaders(forwardReq.Header, hopHeaders...)\n```\n\nThis 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.\n\nA similar pattern exists in snippet-based auth:\n\nReference : [`pkg/middlewares/ingressnginx/snippet/snippet.go#L574-L581`](https://github.com/traefik/traefik/blob/174e5d81111d8e9fb3d3c81cf6d22f3e33eb4f78/pkg/middlewares/ingressnginx/snippet/snippet.go#L574-L581)\n\n```go\nutils.CopyHeaders(forwardReq.Header, req.Header)\nRemoveConnectionHeaders(forwardReq)\nutils.RemoveHeaders(forwardReq.Header, hopHeaders...)\n```\n\nAgain, headers are forwarded without enforcing a consistent trust model or canonicalization.\n\nThe vulnerability emerges when the auth backend normalizes header names (e.g., treating `X_Forwarded_Proto` and `X-Forwarded-Proto` equivalently). In that case:\n\n- Traefik sanitizes only canonical headers.\n- Alias headers remain attacker-controlled.\n- The auth service merges or evaluates these aliases during normalization.\n- Trust predicates (e.g., scheme = HTTPS, trusted host) are satisfied using spoofed values.\n\nThis allows a single crafted request to simultaneously bypass ingress trust enforcement and satisfy authentication checks, resulting in unauthorized access to protected backends.\n\n### PoC\n\n1. Configure a protected route using ForwardAuth or snippet-based auth, with an auth backend that normalizes header names (underscore ↔ dash).\n2. Send a control request (expected: denied):\n\n```http\nGET / HTTP/1.1\nHost: target.local\nUser-Agent: poc-control\nConnection: close\n```\n\n3. Send an exploit request with alias headers (expected: allowed):\n\n```http\nGET /protected HTTP/1.1\nHost: app.example.local\nX_Forwarded_Proto: https\nX_Forwarded_Host: trusted.example\nConnection: close\n```\n\n### Impact\nThis 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.\n\n### Suggested Remediation\n1. Strip and regenerate both canonical and alias forms of forwarded headers consistently at ingress and during auth subrequests.\n2. Apply a unified normalization policy across all forwarded header families (including RFC7239 and `X-Forwarded-*`).\n3. Restrict which headers are forwarded to auth services (prefer explicit allowlists).\n4. Add regression tests covering alias normalization inconsistencies across common backend frameworks.\n\n</details>\n\n---",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/traefik/traefik/v3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.7.0-ea.1"
}, {
"fixed" : "3.7.0-rc.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/traefik/traefik/v3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0-beta1"
}, {
"fixed" : "3.6.14"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/traefik/traefik/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.11.43"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/traefik/traefik"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "1.7.34"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/traefik/traefik/security/advisories/GHSA-5m6w-wvh7-57vm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39858"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/traefik/traefik"
}, {
"type" : "WEB",
"url" : "https://github.com/traefik/traefik/releases/tag/v2.11.43"
}, {
"type" : "WEB",
"url" : "https://github.com/traefik/traefik/releases/tag/v3.6.14"
}, {
"type" : "WEB",
"url" : "https://github.com/traefik/traefik/releases/tag/v3.7.0-rc.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-290", "CWE-306" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-24T16:32:34Z",
"nvd_published_at" : "2026-04-30T21:16:32Z"
}
}