CVE-2026-39858 — Vulnerability in traefik/traefik/v2 — CVE Details
Traefik: Pre-authentication decision bypass due to forwarded alias spoofing
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.74%). Schedule for your next planned update.
Does your project use an affected github.com/traefik/traefik/v2 version?
Paste your go.sum to check it for CVE-2026-39858 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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
- https://github.com/traefik/traefik/releases/tag/v2.11.43
- https://github.com/traefik/traefik/releases/tag/v3.6.14
- https://github.com/traefik/traefik/releases/tag/v3.7.0-rc.2
For more information
If there are any questions or comments about this advisory, please open an issue.
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
- Configure a protected route using ForwardAuth or snippet-based auth, with an auth backend that normalizes header names (underscore ↔ dash).
- Send a control request (expected: denied):
GET / HTTP/1.1
Host: target.local
User-Agent: poc-control
Connection: close
- 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
- Strip and regenerate both canonical and alias forms of forwarded headers consistently at ingress and during auth subrequests.
- Apply a unified normalization policy across all forwarded header families (including RFC7239 and
X-Forwarded-*). - Restrict which headers are forwarded to auth services (prefer explicit allowlists).
- Add regression tests covering alias normalization inconsistencies across common backend frameworks.
Advisory Timeline
- First published April 24, 2026 (216 days ago).
- Last revised June 25, 2026 — 62 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get github.com/traefik/traefik/v2@v2.11.43
go get github.com/traefik/traefik/v3@v3.6.14
go get github.com/traefik/traefik/v3@v3.7.0-rc.2
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (4)
Affects 1 ecosystem: Go (3).
| Package | Fixed In |
|---|---|
| github.com/traefik/traefik/v2 Go · Affected: All versions | 2.11.43 |
| github.com/traefik/traefik/v3 Go · Affected: All versions | 3.6.14 |
| github.com/traefik/traefik/v3 Go · Affected: All versions | 3.7.0-rc.2 |
| github.com/traefik/traefik Go · Affected: All versions | Range-based data available |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-290
- CWE-306
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 10.0 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
References
- https://github.com/traefik/traefik/security/advisories/GHSA-5m6w-wvh7-57vmWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-39858ADVISORY
- https://github.com/traefik/traefikPACKAGE
- https://github.com/traefik/traefik/releases/tag/v2.11.43WEB
- https://github.com/traefik/traefik/releases/tag/v3.6.14WEB
- https://github.com/traefik/traefik/releases/tag/v3.7.0-rc.2WEB
Frequently Asked Questions
- What is CVE-2026-39858?
- Traefik: Pre-authentication decision bypass due to forwarded alias spoofing. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 10.0/10).
- How do I check if my project is affected by CVE-2026-39858?
- CVE-2026-39858 affects github.com/traefik/traefik/v2, github.com/traefik/traefik/v3 and github.com/traefik/traefik. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-39858 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is an above-median EPSS score — 50.6% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-65600CRITICAL
Traefik: Authentication Bypass via Path Traversal in ReplacePathRegex Middleware
- CVE-2026-71324HIGH
Traefik: Cross-user response poisoning via proxied CONNECT on Traefik's shared backend keep-alive pool
- CVE-2026-35051HIGH
Traefik's ForwardAuth trustForwardHeader=false allows spoofed X-Forwarded-Prefix to bypass authentication
- CVE-2026-40912HIGH
Traefik has an StripPrefixRegex Middleware Authorization Bypass via Path/RawPath Desync
- CVE-2025-32431HIGH
Traefik has a possible vulnerability with its path matchers
- CVE-2026-53622HIGH
Traefik: HTTP/3 mTLS bypass via exact SNI TLSOptions lookup for wildcard and mixed-case hosts
- CVE-2026-32305HIGH
Traefik has a Potential mTLS Bypass via Fragmented TLS ClientHello Causing Pre-SNI Sniff Fallback to Default Non-mTLS TLS Config
- CVE-2026-44774MEDIUM
Traefik: Gateway API TraefikService backend accepts rest@internal, allowing unauthorized exposure of the REST provider despite providers.rest.insecure=false