CVE-2026-33433: Traefik Vulnerable to BasicAuth/DigestAuth Identity Spoofing via Non-Canonical headerField

Published Mar 27, 2026
·
Updated

## Summary There is a potential vulnerability in Traefik's Basic and Digest authentication middlewares when `headerField` is configured with a non-canonical HTTP header name. An authenticated attacker with valid credentials can inject the canonical version of the configured header to impersonate any identity to the backend. Because Traefik writes the authenticated username using a non-canonical map key, it creates a separate header entry rather than overwriting the attacker's canonical one — causing most backend frameworks to read the attacker-controlled value instead. ## Patches - <https://github.com/traefik/traefik/releases/tag/v2.11.42> - <https://github.com/traefik/traefik/releases/tag/v3.6.12> - <https://github.com/traefik/traefik/releases/tag/v3.7.0-ea.3> ## 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 When `headerField` is configured with a non-canonical HTTP header name (e.g., `x-auth-user` instead of `X-Auth-User`), an authenticated attacker can inject a canonical version of that header to impersonate any identity to the backend. The backend receives two header entries — the attacker-injected canonical one is read first, overriding Traefik's non-canonical write. Tested on Traefik v3.6.10. ### Details At `pkg/middlewares/auth/basic_auth.go:92`, the authenticated username is written using direct map assignment: ```go req.Header[b.headerField] = []string{user} ``` Go's `http.Header` map is keyed by canonical names (e.g., `X-Auth-User`). Direct assignment with a non-canonical key (`x-auth-user`) creates a separate map entry from any canonical-key entry already present. The attacker's `X-Auth-User: superadmin` occupies the canonical slot and is never overwritten by Traefik's non-canonical write. The same bug exists in `pkg/middlewares/auth/digest_auth.go:100`. Notably, `forward.go:254` correctly uses `http.CanonicalHeaderKey()`, showing the fix pattern already exists in the codebase. ### PoC **Traefik config (YAML, Docker labels, or REST API):** ```yaml middlewares: auth: basicAuth: users: ["admin:$2y$05$..."] headerField: "x-auth-user" ``` **Normal request (baseline):** ```bash curl -u admin:admin http://traefik/secure/test # Backend receives: x-auth-user: admin # Identity = admin ✓ ``` **Attack request:** ```bash curl -u admin:admin -H "X-Auth-User: superadmin" http://traefik/secure/test # Backend receives BOTH headers: # X-Auth-User: superadmin ← attacker-injected (canonical key, read first by most frameworks) # x-auth-user: admin ← Traefik-set (non-canonical, ignored by most frameworks) # Identity seen by backend = superadmin ✗ ``` **Control test** — when `headerField` uses canonical casing (`X-Auth-User`), the attack fails. Traefik's write correctly overwrites the attacker's header. This is realistic because YAML conventions favor lowercase keys, Traefik docs don't warn about canonicalization, and the pattern of backends trusting the `headerField` header is recommended in Traefik's own documentation. **Fix suggestion:** ```go // basic_auth.go:92 and digest_auth.go:100 — change: req.Header[b.headerField] = []string{user} // to: req.Header.Set(b.headerField, user) ``` Also strip any incoming `headerField` header before the auth check with `req.Header.Del(b.headerField)`. ### Impact An authenticated attacker with valid credentials (even low-privilege) can impersonate any other user identity to backend services. If backends use the `headerField` header for authorization decisions (which is the intended use case per Traefik docs), this enables privilege escalation — e.g., a regular user impersonating an admin. The attack requires the operator to configure `headerField` with a non-canonical header name, which is the natural thing to do in YAML and is not warned against in documentation. </details>

Affected Software

8 affected componentsFixes available
Traefik Labs Traefik<2.11.42, <3.6.11, <3.7.0-ea.3
go/github.com/traefik/traefik/v3>=3.7.0-ea.1<3.7.0-ea.3
3.7.0-ea.3
go/github.com/traefik/traefik/v3>=3.0.0-beta1<3.6.11
3.6.12
go/github.com/traefik/traefik/v2<2.11.42
2.11.42
Traefik traefik<2.11.42
Traefik traefik>=3.0.0<3.6.12
Traefik traefik=3.7.0-ea1
Traefik traefik=3.7.0-ea2

Event History

Mar 27, 2026
CVE Published
via MITRE·01:49 PM
Data Sourced
via MITRE·01:49 PM
DescriptionWeakness
Data Sourced
via NVD·03:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 PM
RemedyAffected Software
Advisory Published
via GitHub·08:35 PM
Data Sourced
via GitHub·08:35 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-33433?

The severity of CVE-2026-33433 is rated as high due to the potential for identity spoofing.

2

How do I fix CVE-2026-33433?

To fix CVE-2026-33433, upgrade Traefik to versions 2.11.42, 3.6.11, or 3.7.0-ea.3 or later.

3

What type of vulnerability is CVE-2026-33433?

CVE-2026-33433 is a vulnerability related to BasicAuth/DigestAuth identity spoofing.

4

What software is affected by CVE-2026-33433?

CVE-2026-33433 affects Traefik versions prior to 2.11.42, 3.6.11, and 3.7.0-ea.3.

5

How can identity spoofing occur in CVE-2026-33433?

Identity spoofing in CVE-2026-33433 can occur via a non-canonical HTTP header configuration.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203