🛡️ CVE-2026-39858 — traefik

🔴 CVSS 10.0 — Critical ✅ No Known Exploit CWE-290 NVD
10.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Traefik: Pre-authentication decision bypass due to forwarded alias spoofing

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](https://github.com/traefik/traefik/issues).

<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](https://github.com/traefik/traefik/blob/174e5d81111d8e9fb3d3c81cf6d22f3e33eb4f78/pkg/middlewares/forwardedheaders/forwarded_header.go#L29-L36)

```go

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](https://github.com/traefik/traefik/blob/174e5d81111d8e9fb3d3c81cf6d22f3e33eb4f78/pkg/middlewares/auth/forward.go#L401-L408)

```go

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](https://github.com/traefik/traefik/blob/174e5d81111d8e9fb3d3c81cf6d22f3e33eb4f78/pkg/middlewares/ingressnginx/snippet/snippet.go#L574-L581)

```go

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):

```http

GET / HTTP/1.1

Host: target.local

User-Agent: poc-control

Connection: close

```

3. Send an exploit request with alias headers (expected: allowed):

```http

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 throu

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability none.

Weakness class

CVE-2026-39858 is classified as CWE-290: Authentication Bypass by Spoofing. Identity is inferred from something an attacker can forge, such as a header or address.

Affected software

CVE-2026-39858 is recorded against 4 packages.

  • github.com/traefik/traefik
  • github.com/traefik/traefik/v2
  • github.com/traefik/traefik/v3
  • traefik

Timeline and source

Published on 24 April 2026 and last revised on 25 June 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)
github.com (Web)
github.com (Web)

Details

Severity HIGH
CVSS Score 10.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
CWE CWE-290
Public Exploit ✅ No
Source NVD
Published 2026-04-24
Updated 2026-08-12
Modified 2026-06-25

Affected Packages

Software From version Fixed in
github.com/traefik/traefik
github.com/traefik/traefik/v2
github.com/traefik/traefik/v3
traefik

Similar Threats

Exploit Protection

Are you running traefik?

CVE-2026-39858 carries CVSS 10.0 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-39858 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026