OSV 1.4.0 · github-reviewed · 修改于 2026-08-07 00:40
发布时间
2026-08-07 00:40
GitHub 审查时间
2026-08-07 00:40
NVD 发布时间
2026-07-07 05:16
源文件
advisories/github-reviewed/2026/08/GHSA-6p8f-p8j2-rqmv/GHSA-6p8f-p8j2-rqmv.json
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.
<details> <summary>Original Description</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: Medium/High, configuration-dependent.
</details>Suggested CVSS 3.1:
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:N
Notes:
Suggested CWE:
CWE-863: Incorrect Authorization
CWE-284: Improper Access Control
pkg/provider/kubernetes/gateway/httproute.go — loadService(), loadMiddlewares()
Confirmed on:
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:
// 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:
// 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:
// 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.
allowedRoutes.namespaces.from: All.HTTPRoute route-a in namespace default targets default/whoami:80 with backendRef filter setting X-Tenant: tenant-a.HTTPRoute route-b in namespace attacker targets default/whoami:80 (via ReferenceGrant) with backendRef filter setting X-Tenant: tenant-b.default-whoami-http-80.maps.Copy.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:
{
"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:
The PoC files can be shared upon request.
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.
2026-06-04: Discovered and reproduced with local test harness.