Traefik: Gateway API route identity collision allows cross-namespace backend hijacking
There is a high severity vulnerability in Traefik's Kubernetes Gateway API provider. Router and service identities for HTTPRoute, GRPCRoute, TCPRoute and TLSRoute objects were built by hyphen-concatenating the route namespace, the route name, the Gateway identity, the entry point and the rule index, a construction that is not injective because Kubernetes names may themselves contain hyphens. Two distinct Routes attached to the same Gateway with equivalent match rules can therefore produce the same identity, and the Route loaded later silently overwrites the earlier one, so a tenant able to create an accepted Route in a colliding namespace/name combination can redirect another namespace's traffic to a backend it controls. All Traefik v3 minor lines are affected; the lines older than v3.6 are no longer maintained and will not receive a patch of their own, so users running them should upgrade to a maintained, patched release.
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's Kubernetes Gateway provider constructs internal HTTPRoute and
GRPCRoute identities by concatenating namespace, route name, Gateway identity,
entrypoint, and rule index with hyphens. Kubernetes names may themselves
contain hyphens, so the construction is not injective.
For example, HTTPRoutes team/a-app and team-a/app, attached to the same
Gateway with the same match rule, produce identical router and service keys.
During configuration merging, the route loaded later overwrites the earlier
route's maps. A tenant that can create an accepted Route in a colliding
namespace/name combination can therefore redirect another namespace's
traffic to an attacker-controlled backend.
The official v3.7.8 binary was reproduced returning the victim backend before
the second Route was created and the attacker backend immediately afterward.
The victim Route had the earlier creation timestamp and should win the
equivalent-match conflict under Gateway API precedence rules.
The HTTPRoute provider creates a route key as follows:
```go
routeKey := provider.Normalize(fmt.Sprintf(
"%s-%s-%s-gw-%s-%s-ep-%s-%d",
strings.ToLower(kindHTTPRoute),
route.Namespace,
route.Name,
gatewayNamespace,
gatewayName,
listener.EPName,
ri,
))
```
Normalize replaces non-alphanumeric runs with -, but it does not encode
field lengths or otherwise preserve component boundaries:
```go
func Normalize(name string) string {
fargs := func(c rune) bool {
return !unicode.IsLetter(c) && !unicode.IsNumber(c)
}
return strings.Join(strings.FieldsFunc(name, fargs), "-")
}
```
These distinct objects therefore have the same normalized key:
```text
namespace=team, route=a-app
namespace=team-a, route=app
httproute-team-a-app-gw-gateway-shared-ep-web-0
```
makeRouterName adds a hash of the routing rule. When the attacker copies the
victim's hostname and path, that hash is also identical. Child service and
middleware names are derived from the same parent identity.
Each Route is built into a temporary configuration and then merged into the
provider-wide configuration with maps.Copy:
```go
maps.Copy(to.HTTP.Routers, from.HTTP.Routers)
maps.Copy(to.HTTP.Middlewares, from.HTTP.Middlewares)
maps.Copy(to.HTTP.Services, from.HTTP.Services)
maps.Copy(to.HTTP.ServersTransports, from.HTTP.ServersTransports)
```
maps.Copy replaces an existing value for a duplicate key. No collision is
reported, and the resulting router points to the later Route's backend. The
GRPCRoute implementation uses the same delimiter-free route-key format and
the same HTTP configuration merge path.
The attacker needs permission to create or modify an HTTPRoute or GRPCRoute
that the shared Gateway accepts. Exploitation also requires namespace and
Route names whose concatenation collides with a victim. The attacker does not
need permission to read or modify the victim Route, Service, or namespace.
Prerequisites:
kubectl configured for that cluster;The following script embeds all objects used by the reproduction. It runs the
official traefik:v3.7.8 image, creates the victim Route first, verifies the
victim backend, then creates the colliding attacker Route and repeats the
request.
```bash
#!/usr/bin/env bash
set -euo pipefail
kubectl apply -f - <<'YAML'
apiVersion: v1
kind: Namespace
metadata:
name: gateway
apiVersion: v1
kind: Namespace
metadata:
name: team
apiVersion: v1
kind: Namespace
metadata:
name
CVE-2026-71327 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)
github.com (Fix)
github.com (Fix)
github.com (Web)
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
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/traefik/traefik | — | — |
| github.com/traefik/traefik/v2 | — | — |
| github.com/traefik/traefik/v3 | — | — |
| unknown | — | — |
References
Similar Threats
Site Security Check
CVE-2026-71327 is rated CVSS 8.0 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.