CVE-2026-54765: Traefik Gateway HTTPRoute BackendRef Filters Can Vulnerability

MODERATE
Advisory Identifier: GHSA-6p8f-p8j2-rqmv
CWE-284 CWE-863
Published
Advisory Summary

CVE-2026-54765 is a MODERATE gateway httproute backendref filters can vulnerability (CWE-284: Improper Access Control) affecting Traefik libraries in the Go ecosystem. The issue involves gateway httproute backendref filters can leak backend context across routes sharing a service:port. Remediation is available by upgrading affected packages to version 3.7.6.

CVE-2026-54765 at a Glance

CVE Identifier CVE-2026-54765
GHSA Identifier GHSA-6p8f-p8j2-rqmv
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-284: Improper Access Control
Affected Product Traefik
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-54765

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.

github.com/traefik/traefik/v3 fixed: 3.7.6
Upgrade github.com/traefik/traefik/v3 to 3.7.6
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/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-54765, 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.6), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. 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

## Summary There is a medium severity vulnerability in Traefik's Kubernetes Gateway API provider. When two accepted HTTPRoutes target the same backend Service:port but configure different `backendRef` filters, Traefik may resolve both routes to the same child service and apply only one route's filter set to all requests reaching that backend. In Gateway deployments where `backendRef` filters set security-sensitive headers — such as tenant identity, authorization context, or values the backend trusts — an attacker who can create an accepted HTTPRoute sharing the same backend Service:port may cause their route's filter context to be applied to another route's requests, potentially crossing namespace boundaries when a `ReferenceGrant` permits cross-namespace targeting. ## Patches - https://github.com/traefik/traefik/releases/tag/v3.7.6 ## For more information If you have any questions or comments about this advisory, please [open an issue](https://github.com/traefik/traefik/issues). <details> <summary>Original Description</summary> # Traefik Gateway HTTPRoute backendRef filter context collision across routes sharing Service:port ## Summary Traefik's Kubernetes Gateway API provider builds the dynamic HTTP backend service key for a Gateway `HTTPRoute` backendRef from only the backend namespace, Service name, protocol, and port. It does not include the HTTPRoute, listener, rule, or backendRef filter identity in that key. When two accepted HTTPRoutes point to the same backend `Service:port` but define different backendRef filters, Traefik can make both route WRR services reference the same child service. The child service then carries only one backendRef filter set, so one route can send requests to the backend with another route's backend context. This is security-relevant when backendRef filters set, remove, or rewrite security-sensitive context, such as tenant, identity, auth, sanitization, Host, or path headers trusted by the backend. Credit: Qican Ma, Ding Luo @XiaoMi ShadowBlade Security Lab ## Suggested Severity Suggested severity: Medium/High, configuration-dependent. Suggested CVSS 3.1: ```text CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:N ``` Notes: - Requires Gateway API routes sharing the same backend Service:port with different security-sensitive backendRef filters trusted by the backend. - Cross-namespace impact is possible when route attachment and ReferenceGrant policy allow an attacker route to target the shared backend. - No RCE, memory corruption, or default-config exposure claimed. Suggested CWE: ```text CWE-863: Incorrect Authorization CWE-284: Improper Access Control ``` ## Affected Component ```text pkg/provider/kubernetes/gateway/httproute.go — loadService(), loadMiddlewares() ``` ## Tested Versions Confirmed on: ```text Traefik source snapshot: 29406d42898547f1ffabd904f66af06c212740cf on master ``` Earliest affected version not exhaustively determined. ## Root Cause `loadService` starts the dynamic service name from backend namespace and Service name only: ```go // pkg/provider/kubernetes/gateway/httproute.go:245 serviceName := provider.Normalize(namespace + "-" + string(backendRef.Name) + "-http") ``` It loads backendRef filters using that same service name before appending the backend port: ```go // pkg/provider/kubernetes/gateway/httproute.go:258 middlewares, err := p.loadMiddlewares(conf, namespace, serviceName, backendRef.Filters, pathMatch) ``` For normal Kubernetes Services, the final child service key appends only the port: ```go // pkg/provider/kubernetes/gateway/httproute.go:304-317 portStr := strconv.FormatInt(int64(port), 10) serviceName = provider.Normalize(serviceName + "-" + portStr) ... conf.HTTP.Services[serviceName] = &dynamic.Service{LoadBalancer: lb, Middlewares: middlewares} ``` Each route/rule WRR service references the child service by name. Later route configs are merged by map key (`maps.Copy`), so both route-local WRR services can point to the same child service, which retains only one of the route/backendRef filter configurations. ## Attack Scenario 1. Gateway listener with `allowedRoutes.namespaces.from: All`. 2. Victim `HTTPRoute` `route-a` in namespace `default` targets `default/whoami:80` with backendRef filter setting `X-Tenant: tenant-a`. 3. Attacker-controlled `HTTPRoute` `route-b` in namespace `attacker` targets `default/whoami:80` (via ReferenceGrant) with backendRef filter setting `X-Tenant: tenant-b`. 4. Both routes generate the same child service key: `default-whoami-http-80`. 5. The second route's filter configuration overwrites the first (or vice versa) via `maps.Copy`. 6. Backend receives both routes' requests with one tenant's header context. ## Proof of Concept A Go test harness injects provider-level and server-level tests into the Traefik checkout. The provider test confirms the generated dynamic configuration collision. The server test builds Traefik's runtime router/service/middleware pipeline and sends `httptest` requests through router matching, WRR service dispatch, service-level backendRef middleware, and backend proxy capture. Observed result: ```json { "name": "positive_cross_namespace_same_backend_filter_collision", "pass": true, "expected": {"route-a": "tenant-a", "route-b": "tenant-b"}, "observed": {"route-a": "tenant-a", "route-b": "tenant-a"}, "runtimeObserved": {"route-a": "tenant-a", "route-b": "tenant-a"}, "childServices": {"route-a": "default-whoami-http-80", "route-b": "default-whoami-http-80"} } ``` Negative controls confirmed: - Separate backend Service:port keys produce correct per-route filter isolation. - Identical filters across routes produce no security-relevant difference. The PoC files can be shared upon request. ## Impact An actor who can create or modify an accepted HTTPRoute can cause another accepted route that targets the same backend Service:port to use the wrong backendRef filter context. In cross-namespace Gateway deployments, this can cross namespace boundaries. High-value impact: gateway-injected tenant, identity, auth, role, header sanitization, Host rewrite, or path rewrite context is trusted by the backend. Lower-value impact: the overwritten header is informational or observability-only. ## Suggested Remediation 1. Include route/listener/rule/backendRef filter identity in the generated child service name when backendRef filters are present. 2. Split the load-balancer service from the backendRef filter application so per-route backend filters remain route-scoped. 3. Detect conflicting backendRef filters for the same generated service key and reject or disambiguate the configuration. ## Timeline ```text 2026-06-04: Discovered and reproduced with local test harness. ``` </details> ---

CVE-2026-54765 Affected Traefik Versions

1 component(s)
Fixed Versions:
3.7.6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/traefik/traefik/v3
Go
≥ 3.7.0
< 3.7.6
3.7.6

References

Frequently Asked Questions

What is CVE-2026-54765?
CVE-2026-54765 is a security vulnerability in Traefik involving Gateway HTTPRoute backendRef filters can leak backend context across routes sharing a Service:port under CWE-284: Improper Access Control.
Which Traefik versions are affected?
Affected versions include releases prior to 3.7.6 across affected packages: github.com/traefik/traefik/v3.
What version fixes CVE-2026-54765?
Upgrading to 3.7.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/traefik/traefik/v3 affected?
Yes, github.com/traefik/traefik/v3 is affected in releases prior to 3.7.6. Upgrade your dependency to 3.7.6 or later.
What CWE is associated with CVE-2026-54765?
CVE-2026-54765 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Go dependencies for CVE-2026-54765?
Run the dependency tree command: 'inspect dependencies for github.com/traefik/traefik/v3'. 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-6p8f-p8j2-rqmv",
  "modified" : "2026-08-06T16:40:31Z",
  "published" : "2026-08-06T16:40:31Z",
  "aliases" : [ "CVE-2026-54765" ],
  "summary" : "Traefik: Gateway HTTPRoute backendRef filters can leak backend context across routes sharing a Service:port",
  "details" : "## Summary\n\nThere is a medium severity vulnerability in Traefik's Kubernetes Gateway API provider.\nWhen two accepted HTTPRoutes target the same backend Service:port but configure different\n`backendRef` filters, Traefik may resolve both routes to the same child service and apply\nonly one route's filter set to all requests reaching that backend. In Gateway deployments\nwhere `backendRef` filters set security-sensitive headers — such as tenant identity,\nauthorization context, or values the backend trusts — an attacker who can create an\naccepted HTTPRoute sharing the same backend Service:port may cause their route's filter\ncontext to be applied to another route's requests, potentially crossing namespace\nboundaries when a `ReferenceGrant` permits cross-namespace targeting.\n\n## Patches\n\n- https://github.com/traefik/traefik/releases/tag/v3.7.6\n\n## For more information\n\nIf you have 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# Traefik Gateway HTTPRoute backendRef filter context collision across routes sharing Service:port\n\n## Summary\n\nTraefik's Kubernetes Gateway API provider builds the dynamic HTTP backend service key for a Gateway `HTTPRoute` backendRef from only the backend namespace, Service name, protocol, and port. It does not include the HTTPRoute, listener, rule, or backendRef filter identity in that key.\n\nWhen two accepted HTTPRoutes point to the same backend `Service:port` but define different backendRef filters, Traefik can make both route WRR services reference the same child service. The child service then carries only one backendRef filter set, so one route can send requests to the backend with another route's backend context.\n\nThis is security-relevant when backendRef filters set, remove, or rewrite security-sensitive context, such as tenant, identity, auth, sanitization, Host, or path headers trusted by the backend.\n\nCredit: Qican Ma, Ding Luo @XiaoMi ShadowBlade Security Lab\n\n## Suggested Severity\n\nSuggested severity: Medium/High, configuration-dependent.\n\nSuggested CVSS 3.1:\n\n```text\nCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:N\n```\n\nNotes:\n\n- Requires Gateway API routes sharing the same backend Service:port with different security-sensitive backendRef filters trusted by the backend.\n- Cross-namespace impact is possible when route attachment and ReferenceGrant policy allow an attacker route to target the shared backend.\n- No RCE, memory corruption, or default-config exposure claimed.\n\nSuggested CWE:\n\n```text\nCWE-863: Incorrect Authorization\nCWE-284: Improper Access Control\n```\n\n## Affected Component\n\n```text\npkg/provider/kubernetes/gateway/httproute.go — loadService(), loadMiddlewares()\n```\n\n## Tested Versions\n\nConfirmed on:\n\n```text\nTraefik source snapshot: 29406d42898547f1ffabd904f66af06c212740cf on master\n```\n\nEarliest affected version not exhaustively determined.\n\n## Root Cause\n\n`loadService` starts the dynamic service name from backend namespace and Service name only:\n\n```go\n// pkg/provider/kubernetes/gateway/httproute.go:245\nserviceName := provider.Normalize(namespace + \"-\" + string(backendRef.Name) + \"-http\")\n```\n\nIt loads backendRef filters using that same service name before appending the backend port:\n\n```go\n// pkg/provider/kubernetes/gateway/httproute.go:258\nmiddlewares, err := p.loadMiddlewares(conf, namespace, serviceName, backendRef.Filters, pathMatch)\n```\n\nFor normal Kubernetes Services, the final child service key appends only the port:\n\n```go\n// pkg/provider/kubernetes/gateway/httproute.go:304-317\nportStr := strconv.FormatInt(int64(port), 10)\nserviceName = provider.Normalize(serviceName + \"-\" + portStr)\n...\nconf.HTTP.Services[serviceName] = &dynamic.Service{LoadBalancer: lb, Middlewares: middlewares}\n```\n\nEach route/rule WRR service references the child service by name. Later route configs are merged by map key (`maps.Copy`), so both route-local WRR services can point to the same child service, which retains only one of the route/backendRef filter configurations.\n\n## Attack Scenario\n\n1. Gateway listener with `allowedRoutes.namespaces.from: All`.\n2. Victim `HTTPRoute` `route-a` in namespace `default` targets `default/whoami:80` with backendRef filter setting `X-Tenant: tenant-a`.\n3. Attacker-controlled `HTTPRoute` `route-b` in namespace `attacker` targets `default/whoami:80` (via ReferenceGrant) with backendRef filter setting `X-Tenant: tenant-b`.\n4. Both routes generate the same child service key: `default-whoami-http-80`.\n5. The second route's filter configuration overwrites the first (or vice versa) via `maps.Copy`.\n6. Backend receives both routes' requests with one tenant's header context.\n\n## Proof of Concept\n\nA Go test harness injects provider-level and server-level tests into the Traefik checkout. The provider test confirms the generated dynamic configuration collision. The server test builds Traefik's runtime router/service/middleware pipeline and sends `httptest` requests through router matching, WRR service dispatch, service-level backendRef middleware, and backend proxy capture.\n\nObserved result:\n\n```json\n{\n  \"name\": \"positive_cross_namespace_same_backend_filter_collision\",\n  \"pass\": true,\n  \"expected\": {\"route-a\": \"tenant-a\", \"route-b\": \"tenant-b\"},\n  \"observed\": {\"route-a\": \"tenant-a\", \"route-b\": \"tenant-a\"},\n  \"runtimeObserved\": {\"route-a\": \"tenant-a\", \"route-b\": \"tenant-a\"},\n  \"childServices\": {\"route-a\": \"default-whoami-http-80\", \"route-b\": \"default-whoami-http-80\"}\n}\n```\n\nNegative controls confirmed:\n\n- Separate backend Service:port keys produce correct per-route filter isolation.\n- Identical filters across routes produce no security-relevant difference.\n\nThe PoC files can be shared upon request.\n\n## Impact\n\nAn actor who can create or modify an accepted HTTPRoute can cause another accepted route that targets the same backend Service:port to use the wrong backendRef filter context. In cross-namespace Gateway deployments, this can cross namespace boundaries.\n\nHigh-value impact: gateway-injected tenant, identity, auth, role, header sanitization, Host rewrite, or path rewrite context is trusted by the backend.\nLower-value impact: the overwritten header is informational or observability-only.\n\n## Suggested Remediation\n\n1. Include route/listener/rule/backendRef filter identity in the generated child service name when backendRef filters are present.\n2. Split the load-balancer service from the backendRef filter application so per-route backend filters remain route-scoped.\n3. Detect conflicting backendRef filters for the same generated service key and reject or disambiguate the configuration.\n\n## Timeline\n\n```text\n2026-06-04: Discovered and reproduced with local test harness.\n```\n\n</details>\n\n---",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/traefik/traefik/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.7.0"
      }, {
        "fixed" : "3.7.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.7.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/security/advisories/GHSA-6p8f-p8j2-rqmv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54765"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/pull/13367"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/commit/8aada7a7d52e4588a75386d8b86d270f6fe8d549"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/traefik/traefik"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/traefik/traefik/releases/tag/v3.7.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-06T16:40:31Z",
    "nvd_published_at" : "2026-07-06T21:16:57Z"
  }
}