llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/traefik/traefik/v3

GHSA-CJR6-PF59-JQ29

ingress-nginx from-to-www-redirect sibling router serves the auth-protected backend without auth

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche a -1 d de la divulgación
Exposición84 dDesde la divulgación, 27 ago 2026, 2:50 a. m.
Detección83 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche v3.7.12
Monitoreo
Detectada +1
26 ago 26
27 ago 26
18 nov 26
20 nov 26
26 ago 26
16 sept 26
8 oct 26
29 oct 26
20 nov 26
FechaFaseEventoDetalle
Remediación Parche v3.7.12 github.com/traefik/traefik/v3 · -1 d desde divulgación
Divulgación Publicada GHSA-CJR6-PF59-JQ29 divulgada
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

There is a high severity vulnerability in Traefik's Kubernetes ingress-nginx provider. For an Ingress carrying both an authentication annotation and `nginx.ingress.kubernetes.io/from-to-www-redirect`, the provider created a second router matching on the host alone that carried only the `RedirectRegex` middleware while still pointing at the parent's protected backend service. `RedirectRegex` is not a terminal handler: a request its pattern does not match is forwarded to the next handler. Because the redirect pattern accepted only a numeric port while Traefik's host matcher canonicalizes any authority, a request carrying a non-numeric or empty port (`Host: www.example.com:x`) selected the sibling router, missed the redirect, and was proxied to the protected backend with none of the Ingress's annotation-derived middlewares applied. Authentication is not the only middleware lost: every annotation-derived middleware is discarded on that router, so source-IP allowlisting and the rest are equally absent.

Traefik v2 is not affected, and neither is any v3 release before v3.7.0: the ingress-nginx provider's from-to-www-redirect handling was introduced in v3.7.0.

Patches

  • https://github.com/traefik/traefik/releases/tag/v3.7.12

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: the ingress-nginx from-to-www-redirect sibling router serves an auth-protected backend without auth

ANT-ID: ANT-2026-EYY7M3H3

Summary

For a Kubernetes Ingress carrying both an auth annotation and
`nginx.ingress.kubernetes.io/from-to-www-redirect`, the ingress-nginx provider creates a
second router that matches on the host alone, carries only the `RedirectRegex`
middleware, and is pointed at the parent's real backend service. `RedirectRegex` is not a
terminal handler: `pkg/middlewares/redirect/redirect.go` forwards every request its pattern
does not match to the next handler, which for this router is the backend. The pattern
cannot match an authority whose port is not numeric, while `net.SplitHostPort`, and hence
the canonical host the `Host()` matcher compares against, accepts one. So
`Host: www.example.com:x` selects the sibling router, misses the redirect, and is proxied
to the protected backend with no authentication at all. Affects v3.7.10, the latest
release, and HEAD.

> Discovered by AI and verified by humans; credit Calif.io in collaboration with Anthropic.

Technical Details

`applyFromToWwwRedirect()` (`pkg/provider/kubernetes/ingress-nginx/translator.go:546`) is
called immediately after `p.applyMiddlewares()` has populated `rt.Middlewares` with the
Ingress's auth middleware. It then builds a new router that inherits `rt.Service` but
replaces the middleware chain outright:

conf.HTTP.Routers[routerKey+"-from-to-www-redirect"] = &dynamic.Router{
    EntryPoints:   rt.EntryPoints,
    Rule:          f.ExtraRouterRule,     // Host("www.example.com"), no path constraint
    Priority:      rt.Priority,
    Middlewares:   []string{mwName},      // only the redirect; rt.Middlewares discarded
    Service:       rt.Service,            // the parent's protected backend
    TLS:           rt.TLS,
}

The authorization is not bypassed so much as never attached to that route, and because
`applyMiddlewares()` is where every annotation-derived middleware is attached, the sibling
discards all of them, not only BasicAuth. We confirmed the same 401-to-200 transition on an
Ingress guarded by `whitelist-source-range` instead, which returns 403 on the parent and
200 on the sibling.

What turns that into a reachable bypass is a disagreement between two parsers about the
same authority. The redirect pattern is `(https?)://[^/:]+(:[0-9]+)?/(.*)`: `[^/:]+` stops
at the first colon and `(:[0-9]+)?` accepts only digits, so for
`http://www.example.com:x/admin/secret` the optional group matches empty and the pattern
then requires `/` while the next character is still `:`. No match. Meanwhile
`requestdecorator` derives the canonical host with `net.SplitHostPort`, which accepts that
authority and yields `www.example.com`, so the `Host()` rule selects this router. The
request therefore arrives at a router with no auth, fails to redirect, and falls through to
`r.next`. A bare trailing colon (`Host: www.example.com:`) is sufficient; no exotic value is
needed. Because the sibling rule carries no `PathPrefix`, paths that appear nowhere in the
Ingress are reachable too, and the method is unconstrained.

Reproduce

./run.sh          # ~2 min: builds traefik v3.7.10, runs the provider, drives the exploit

The harness writes no configuration by hand. `poc_dump_test.go` drives the real
ingress-nginx provider over a fake Kubernetes API with an ordinary Ingress carrying
`auth-type: basic` and `from-to-www-redirect`, and the configuration it emits is what the
traefik binary then serves. The provider output shows the defect before any request is
sent: a sibling router with `service: default-poc-protected-80` and `middlewares:
[redirect only]`.

GET /admin/secret   Host: example.com         no creds  -> 401 Unauthorized   origin not reached
GET /admin/secret   Host: example.com         creds     -> 200 + secret       origin reached
GET /admin/secret   Host: www.example.com:x   no creds  -> 200 + secret       origin reached

The origin logs `BACKEND-RECEIVED request-line='GET /admin/secret HTTP/1.1'
host='www.example.com:x'`, and the response carries the origin's own `X-Served-By` header
and body, so the request was proxied rather than redirected.

Four cases isolate the mechanism, each differing from the exploit in one respect:
`Host: www.example.com` (no port) returns 302 with a correct `Location` and the origin is
not reached; `Host: www.example.com:8080` (numeric port) likewise; `Host:
unrelated.example.net:x` returns 404. The important one is `Host: example.com:x`, the same
malformed authority sent to the parent router, which still returns 401. The malformed
port is not itself an authorization bypass; it is a bypass only because it selects a
sibling router that carries no authorization.

Recommendations

Two independent changes, either of which closes the reported path. The complete diff is in
`suggested-fix.patch`.

First, match the authority as everything up to the path, capturing only a numeric port, so
a malformed or empty port canonicalises into a redirect instead of falling through:

-			Regex:       `(https?)://[^/:]+(:[0-9]+)?/(.*)`,
+			Regex:       `(https?)://[^/]*?(:[0-9]+)?/(.*)`,

Second, point the redirect-only router at the provider's existing 503
`unavailable-service` rather than at the protected backend. That router is never intended
to proxy, and with no auth middleware on it any fall-through is by definition
unauthenticated access, so this removes the class rather than the instance and also covers
inputs the pattern cannot express.

We recognise the second change alters provider output and updates four golden expectations
in `kubernetes_test.go`. The first change alone fixes the reported trigger, so if you would
rather take only that, it stands on its own; we are offering the second as defence in
depth rather than pressing for it.

> Patch verified: with both changes applied, every exploit case becomes a redirect with a
> correct `Location` and the origin is never reached, while the 401, 200, 403 and both
> redirect cases are unchanged. Upstream's own `go test
> ./pkg/provider/kubernetes/ingress-nginx/...` passes.

Notes for the reviewer

  • This is not a regression and not an incomplete patch. We checked the commits rather than
  • One fidelity artifact of the harness, unrelated to the finding:
  • We drove the real provider through a fake Kubernetes API rather than a live cluster. The
  • Reproduced on linux/arm64 with Go 1.26.0, which traefik's `go.mod` requires. This is

Artifacts

| filename | purpose |
|---|---|
| `run.sh` | one command: build v3.7.10, generate the config from the provider, run all cases |
| `poc_dump_test.go` | drives the real ingress-nginx provider over a fake Kubernetes API |
| `poc.py` | the client; `--mode exploit\|control\|postfix` |
| `backend.py` | instrumented origin that logs the raw request line it receives |
| `poc-eyy7m3h3.yml` | the Ingress used |
| `suggested-fix.patch` | both changes, with the golden-fixture updates |
| `exploit_transcript.txt` | full request and response transcript, all cases |

PoC bundle: https://drive.google.com/file/d/18_bwMG_GpvpxVqOeHbRagF4N63z8dehg/view?usp=sharing

</details>

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
github.com/traefik/traefik/v3≥ v3.7.0 ≤ v3.7.11
v3.7.0
v3.7.11
v3.7.19
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/traefik/traefik/v3
Corregida v3.7.12 -1 d v3.7.19 no afectada
Versiones corregidasv3.7.12
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/traefik/traefik/security/advisories/GHSA-cjr6-pf59-jq29

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.