CVE-2026-33433: Github.com/traefik/traefik/v2 Traefik Vulnerable To BasicAuth/DigestAuth Identity Vulnerability

MODERATE
Advisory Identifier: GHSA-qr99-7898-vr7c
CWE-290
Published
Advisory Summary

CVE-2026-33433 is a MODERATE traefik vulnerable to basicauth/digestauth identity vulnerability (CWE-290: Authentication Bypass by Spoofing) affecting Github.com/traefik/traefik/v2 libraries in the Go ecosystem. The issue involves traefik vulnerable to basicauth/digestauth identity spoofing via non-canonical headerfield. Remediation is available by upgrading affected packages to version 2.11.42, 3.6.12, 3.7.0-ea.3.

CVE-2026-33433 at a Glance

CVE Identifier CVE-2026-33433
GHSA Identifier GHSA-qr99-7898-vr7c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-290: Authentication Bypass by Spoofing
Affected Product Github.com/traefik/traefik/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-33433

To remediate this vulnerability, upgrade all affected Github.com/traefik/traefik/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/traefik/traefik/v2 fixed: 2.11.42
Upgrade github.com/traefik/traefik/v2 to 2.11.42
github.com/traefik/traefik/v3 fixed: 3.6.12
Upgrade github.com/traefik/traefik/v3 to 3.6.12
github.com/traefik/traefik/v3 fixed: 3.7.0-ea.3
Upgrade github.com/traefik/traefik/v3 to 3.7.0-ea.3
Verify Direct and Transitive Dependencies

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/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33433, inspect your project dependencies for Github.com/traefik/traefik/v2:

inspect dependencies for github.com/traefik/traefik/v2

Analyze the terminal output to locate any version of Github.com/traefik/traefik/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.11.42), 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-290: Authentication Bypass by Spoofing, where this attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks. In Github.com/traefik/traefik/v2, 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

## 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>

CVE-2026-33433 Affected Github.com/traefik/traefik/v2 Versions

3 component(s)
Fixed Versions:
2.11.423.6.123.7.0-ea.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/traefik/traefik/v2
Go
< 2.11.42
2.11.42
github.com/traefik/traefik/v3
Go
≥ 3.0.0-beta1
< 3.6.12
3.6.12
github.com/traefik/traefik/v3
Go
≥ 3.7.0-ea.1
< 3.7.0-ea.3
3.7.0-ea.3

References

Frequently Asked Questions

What is CVE-2026-33433?
CVE-2026-33433 is a security vulnerability in Github.com/traefik/traefik/v2 involving Traefik Vulnerable to BasicAuth/DigestAuth Identity Spoofing via Non-Canonical headerField under CWE-290: Authentication Bypass by Spoofing.
Which Github.com/traefik/traefik/v2 versions are affected?
Affected versions include releases prior to 2.11.42, 3.6.12, 3.7.0-ea.3 across affected packages: github.com/traefik/traefik/v2, github.com/traefik/traefik/v3.
What version fixes CVE-2026-33433?
Upgrading to 2.11.42, 3.6.12, 3.7.0-ea.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/traefik/traefik/v2 affected?
Yes, github.com/traefik/traefik/v2 is affected in releases prior to 2.11.42. Upgrade your dependency to 2.11.42 or later.
Is github.com/traefik/traefik/v3 affected?
Yes, github.com/traefik/traefik/v3 is affected in releases prior to 3.6.12, 3.7.0-ea.3. Upgrade your dependency to 3.6.12, 3.7.0-ea.3 or later.
What CWE is associated with CVE-2026-33433?
CVE-2026-33433 is classified under CWE-290: Authentication Bypass by Spoofing (This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.).
How can I check Go dependencies for CVE-2026-33433?
Run the dependency tree command: 'inspect dependencies for github.com/traefik/traefik/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qr99-7898-vr7c",
  "modified" : "2026-03-27T20:35:53Z",
  "published" : "2026-03-27T20:35:53Z",
  "aliases" : [ "CVE-2026-33433" ],
  "summary" : "Traefik Vulnerable to BasicAuth/DigestAuth Identity Spoofing via Non-Canonical headerField",
  "details" : "## Summary\n\nThere is a potential vulnerability in Traefik's Basic and Digest authentication middlewares when `headerField` is configured with a non-canonical HTTP header name.\n\nAn 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.\n\n## Patches\n\n- <https://github.com/traefik/traefik/releases/tag/v2.11.42>\n- <https://github.com/traefik/traefik/releases/tag/v3.6.12>\n- <https://github.com/traefik/traefik/releases/tag/v3.7.0-ea.3>\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---\n\n<details>\n<summary>Original Description</summary>\n\n### Summary\n\nWhen `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.\n\nTested on Traefik v3.6.10.\n\n### Details\n\nAt `pkg/middlewares/auth/basic_auth.go:92`, the authenticated username is written using direct map assignment:\n\n```go\nreq.Header[b.headerField] = []string{user}\n```\n\nGo'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.\n\nThe 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.\n\n### PoC\n\n**Traefik config (YAML, Docker labels, or REST API):**\n\n```yaml\nmiddlewares:\n  auth:\n    basicAuth:\n      users: [\"admin:$2y$05$...\"]\n      headerField: \"x-auth-user\"\n```\n\n**Normal request (baseline):**\n\n```bash\ncurl -u admin:admin http://traefik/secure/test\n# Backend receives: x-auth-user: admin\n# Identity = admin ✓\n```\n\n**Attack request:**\n\n```bash\ncurl -u admin:admin -H \"X-Auth-User: superadmin\" http://traefik/secure/test\n# Backend receives BOTH headers:\n#   X-Auth-User: superadmin   ← attacker-injected (canonical key, read first by most frameworks)\n#   x-auth-user: admin        ← Traefik-set (non-canonical, ignored by most frameworks)\n# Identity seen by backend = superadmin ✗\n```\n\n**Control test** — when `headerField` uses canonical casing (`X-Auth-User`), the attack fails. Traefik's write correctly overwrites the attacker's header.\n\nThis 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.\n\n**Fix suggestion:**\n\n```go\n// basic_auth.go:92 and digest_auth.go:100 — change:\nreq.Header[b.headerField] = []string{user}\n// to:\nreq.Header.Set(b.headerField, user)\n```\n\nAlso strip any incoming `headerField` header before the auth check with `req.Header.Del(b.headerField)`.\n\n### Impact\n\nAn 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.\n\nThe 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.\n\n</details>",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.11.42"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0-beta1"
      }, {
        "fixed" : "3.6.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 3.6.11"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0-ea.1"
      }, {
        "fixed" : "3.7.0-ea.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/security/advisories/GHSA-qr99-7898-vr7c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33433"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/traefik/traefik"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v2.11.42"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v3.6.11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v3.7.0-ea.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-290" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-27T20:35:53Z",
    "nvd_published_at" : "2026-03-27T15:16:54Z"
  }
}