Traefik: Gateway HTTPRoute backendRef filters can leak backend context across routes sharing a Service:port
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.
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
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: 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:
Suggested CWE:
```text
CWE-863: Incorrect Authorization
CWE-284: Improper Access Control
```
```text
pkg/provider/kubernetes/gateway/httproute.go — loadService(), loadMiddlewares()
```
Confirmed on:
```text
Traefik source snapshot: 29406d42898547f1ffabd904f66af06c212740cf on master
```
Earliest affected version not exhaustively determined.
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.
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.
A Go test harness injects provider-level and server-level tests into the Traefik checkout. The provider test confirms the generated dynamic conf
This issue can be reached over the network, attack complexity is low, an attacker needs low-level 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 low, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
CVE-2026-54765 is recorded against 4 packages.
Published on 18 August 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.
github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Fix)
github.com (Fix)
github.com (Web)
github.com/traefik/traefik has other advisories on record. If you are patching this one, these are worth checking on the same host:
Details
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/traefik/traefik | — | — |
| github.com/traefik/traefik/v2 | — | — |
| github.com/traefik/traefik/v3 | — | — |
| traefik | 3.7.0 | 3.7.6 |
References
Similar Threats
Site Security Check
CVE-2026-54765 is rated CVSS 8.5 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →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.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.