Traefik: Kubernetes Ingress NGINX RewriteTarget Path Traversal Allows Route-Level Authentication Bypass
There is a high severity vulnerability in Traefik's Kubernetes Ingress NGINX provider. When an Ingress uses the nginx.ingress.kubernetes.io/rewrite-target annotation with a regular expression that captures attacker-controlled text without requiring a path separator (for example path /api(.*) with rewrite target /$1), the generated RewriteTarget middleware can turn an initially safe request path into a dot-segment traversal path after the router has already been selected.
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 Ingress NGINX provider creates an internal RewriteTarget middleware for the nginx.ingress.kubernetes.io/rewrite-target annotation. When an Ingress path captures attacker-controlled text without requiring a path separator, the middleware can turn an initially safe path into a dot-segment traversal path after Traefik has already selected the router.
For example, with Ingress path /api(.*) and rewrite target /$1, an unauthenticated request to /api../admin follows this flow:
1. The default entry-point path sanitizer leaves /api../admin unchanged because api.. is one ordinary segment.
2. The public router's PathRegexp("(?i)^/api(.*)") rule matches.
3. RewriteTarget captures ../admin and creates /../admin.
4. The middleware forwards /../admin without checking whether path normalization changes it.
5. A backend that normalizes paths resolves /../admin to /admin.
6. The request reaches content intended to be reachable only through a separate /admin router with BasicAuth, DigestAuth, or ForwardAuth.
This is an unpatched sibling of [GHSA-cxjq-mrr5-89rv](https://github.com/traefik/traefik/security/advisories/GHSA-cxjq-mrr5-89rv), which added post-replacement normalization validation to ReplacePathRegex. The separate ingress-nginx RewriteTarget implementation did not receive the same validation. The bypass remains exploitable in the patched Traefik v3.7.7 release.
Proposed severity: Critical
CVSS 3.1: 9.1 — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Primary weakness: CWE-22 — Improper Limitation of a Pathname to a Restricted Directory (Path Traversal)
Secondary weakness: CWE-288 — Authentication Bypass Using an Alternate Path or Channel
The practical impact depends on the protected backend paths. If they are read-only or low sensitivity, environmental severity may be lower.
rewrite-target with a regex that can capture .. adjacent to the matched prefix, such as /api(.*) with /$1./admin, and relies on a Traefik authentication or authorization middleware.These are deployment prerequisites; the remote attacker needs no credentials or special timing.
master at commit b93f02cd07b79490fb8c8f02e301a7a1ec553195v3.7 branch at 69259c3acc9d4bdc065cb2e3b83336f7de3e7038The vulnerable middleware is present in every stable v3.7 release checked. The v2.11 and v3.6 branches do not contain this ingress-nginx RewriteTarget implementation.
pkg/provider/kubernetes/ingress-nginx/middleware.go:257-274rewrite-target annotation directly into dynamic.RewriteTarget configuration.pkg/middlewares/ingressnginx/rewritetarget/rewrite_target.go:85-157pkg/server/middleware/middlewares.go:346-353The provider passes the route regex and annotation replacement into the middleware:
```go
loc.RewriteTarget = &dynamic.RewriteTarget{
Regex: loc.Path,
Replacement: rewrite,
}
```
RewriteTarget.ServeHTTP then derives a path from attacker-controlled capture groups:
```go
newTarget = rt.regexp.ReplaceAllString(currentPath, rt.replacement)
req.URL.RawPath = newTarget
req.URL.Path, err = url.PathUnescape(req.URL.RawPath)
req.RequestURI = req.URL.RequestURI()
rt.next.ServeHTTP(rw, req)
```
There is no invariant check between `Path
CVE-2026-67309 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)
www.vulncheck.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-67309 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.