{"id":"CVE-2026-40912","aliases":["CVE-2026-40912","GHSA-6jwx-7vp4-9847","GO-2026-5180"],"related":[],"kind":"vulnerability","state":"published","title":"Traefik: StripPrefixRegex auth bypass via Path/RawPath desync","summary":"Traefik is an HTTP reverse proxy and load balancer. Prior to versions 2.11.43, 3.6.14, and 3.7.0-rc.2, there is a high severity authentication bypass vulnerability in Traefik's StripPrefixRegex middleware when used in combination with ForwardAuth, BasicAuth, or DigestAuth. The middleware matches the regex against the decoded URL path but uses the resulting byte length to slice the percent-encoded raw path. When a dot (or multiple dots) appears in the prefix portion of the URL, the raw path after stripping becomes a dot-segment (e.g. /./admin/secret). ForwardAuth receives this dot-segment path in X-Forwarded-Uri, which does not match the protected path patterns and therefore allows the request through. The backend then normalizes the dot-segment to the real path per RFC 3986 and serves the protected content An unauthenticated attacker can exploit this against any backend that performs dot-segment normalization. This issue has been patched in versions 2.11.43, 3.6.14, and 3.7.0-rc.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Traefik is an HTTP reverse proxy and load balancer. Prior to versions 2.11.43, 3.6.14, and 3.7.0-rc.2, there is a high severity authentication bypass vulnerability in Traefik's StripPrefixRegex middleware when used in combination with ForwardAuth, BasicAuth, or DigestAuth. The middleware matches the regex against the decoded URL path but uses the resulting byte length to slice the percent-encoded raw path. When a dot (or multiple dots) appears in the prefix portion of the URL, the raw path after stripping becomes a dot-segment (e.g. /./admin/secret). ForwardAuth receives this dot-segment path in X-Forwarded-Uri, which does not match the protected path patterns and therefore allows the request through. The backend then normalizes the dot-segment to the real path per RFC 3986 and serves the protected content An unauthenticated attacker can exploit this against any backend that performs dot-segment normalization. This issue has been patched in versions 2.11.43, 3.6.14, and 3.7.0-rc.2.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThere is a high severity authentication bypass vulnerability in Traefik's `StripPrefixRegex` middleware when used in combination with `ForwardAuth`, `BasicAuth`, or `DigestAuth`.\n\nThe middleware matches the regex against the decoded URL path but uses the resulting byte length to slice the percent-encoded raw path. When a dot (or multiple dots) appears in the prefix portion of the URL, the raw path after stripping becomes a dot-segment (e.g. `/./admin/secret`).\n\n`ForwardAuth` receives this dot-segment path in `X-Forwarded-Uri`, which does not match the protected path patterns and therefore allows the request through. The backend then normalizes the dot-segment to the real path per RFC 3986 and serves the protected content\n\n An unauthenticated attacker can exploit this against any backend that performs dot-segment normalization.\n\n## Patches\n\n- https://github.com/traefik/traefik/releases/tag/v2.11.43\n- https://github.com/traefik/traefik/releases/tag/v3.6.14\n- https://github.com/traefik/traefik/releases/tag/v3.7.0-rc.2\n\n## For more information\n\nIf there are 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\n\n  StripPrefixRegex uses the byte length of a decoded Path match to slice the encoded RawPath. When percent-encoded characters are in the prefix region, this produces a wrong RawPath. ForwardAuth then\n  receives this wrong path in X-Forwarded-Uri, sees a path that doesn't match its protection rules, and approves the request. The backend serves protected content.\n\n ### Details\n\n  `pkg/middlewares/stripprefixregex/strip_prefix_regex.go`, line 62:\n\n  ```go\n  req.URL.RawPath = ensureLeadingSlash(req.URL.RawPath[len(prefix):])\n```\n\n  prefix comes from matching the regex against the decoded req.URL.Path (line 51). len(prefix) is then used to index into the encoded req.URL.RawPath. These lengths don't match when percent-encoding is\n  present.\n\n  Example with regex ^/api:\n\n  - GET /api%20/admin/secret\n  - Decoded Path: /api /admin/secret -> prefix = /api (4 bytes)\n  - Encoded RawPath: /api%20/admin/secret -> same region is 6 bytes\n  - RawPath[4:] = %20/admin/secret -> after ensureLeadingSlash -> /%20/admin/secret\n  - ForwardAuth sees X-Forwarded-Uri: /%20/admin/secret -> not /admin/* -> allows it\n  - Backend serves the protected admin content\n\n  PoC\n\n  Requires Docker and Docker Compose. I have a setup that runs Traefik v3.6.11 with StripPrefixRegex + ForwardAuth + a backend. It sends a normal request (blocked, 403) and an encoded request (bypasses\n  auth, 200, returns protected data). Can share the files here if useful.\n\n  Impact\n\n  Auth bypass. Any path protected by ForwardAuth, BasicAuth, or DigestAuth can be accessed without credentials when StripPrefixRegex is in the same middleware chain. The attacker only needs to add a\n  percent-encoded character to the prefix portion of the URL.\n\n---\n\n### Updated PoC (reporter follow-up)\n\nAfter further testing, the confirmed working exploit uses `%2e` (percent-encoded dot) rather than `%20`. Dot-segment normalization (`/./` -> `/`) is RFC 3986 standard behavior handled automatically by Express.js, Go's `http.ServeMux`, Spring Boot, and others — no custom configuration needed.\n\nChain:\n\n```\nGET /api%2e/admin/secret\n-> StripPrefixRegex strips /api -> RawPath becomes /./admin/secret\n-> ForwardAuth sees /./admin/secret -> does not match /admin/ -> allows\n-> Express normalizes /./admin/secret -> /admin/secret -> serves protected content\n```\n\nResults (Traefik v3.6, unmodified Express.js express.static):\n\n```\nGET /api/admin/secret      -> 403 (blocked)\nGET /api%2e/admin/secret   -> 200 (bypass — served protected content)\nGET /api%20/admin/secret   -> 404 (space not normalized by backend)\n```\n\nAuth server logs:\n\n```\nX-Forwarded-Uri: '/admin/secret'    -> DENIED\nX-Forwarded-Uri: '/./admin/secret'  -> ALLOWED\n```\n\nReproduction:\n\n```bash\ndocker compose up -d --build --wait\ncurl http://localhost:8080/api/admin/secret                       # -> 403\ncurl --path-as-is \"http://localhost:8080/api%2e/admin/secret\"     # -> 200\n```\n\n</details>\n\n---","format":"markdown","source":"ghsa"},{"lang":"en","text":"Traefik has an StripPrefixRegex Middleware Authorization Bypass via Path/RawPath Desync in github.com/traefik/traefik.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: .","format":"markdown","source":"go"},{"lang":"es","text":"Traefik es un proxy inverso HTTP y balanceador de carga. Antes de las versiones 2.11.43, 3.6.14 y 3.7.0-rc.2, existe una vulnerabilidad de omisión de autenticación de alta severidad en el middleware StripPrefixRegex de Traefik cuando se usa en combinación con ForwardAuth, BasicAuth o DigestAuth. El middleware compara la expresión regular con la ruta URL decodificada, pero usa la longitud de bytes resultante para cortar la ruta raw codificada en porcentaje. Cuando un punto (o múltiples puntos) aparece en la porción de prefijo de la URL, la ruta raw después de ser eliminada se convierte en un segmento de punto (p. ej. /./admin/secret). ForwardAuth recibe esta ruta de segmento de punto en X-Forwarded-Uri, que no coincide con los patrones de ruta protegidos y por lo tanto permite que la solicitud pase. El backend luego normaliza el segmento de punto a la ruta real según RFC 3986 y sirve el contenido protegido. Un atacante no autenticado puede explotar esto contra cualquier backend que realice la normalización de segmentos de punto. Este problema ha sido parcheado en las versiones 2.11.43, 3.6.14 y 3.7.0-rc.2.","source":"nvd"}],"published":"2026-04-24T16:37:53.000Z","modified":"2026-11-23T20:30:09.061Z","severity":{"scorer":"GitHub_M","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:L/SA:N","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","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:L/SA:N","score":7.8,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"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:L/A:N","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","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:L/SA:N","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N","score":8.2,"rating":"HIGH"}],"cwes":["CWE-22","CWE-706"],"affected":[{"ranges":[{"version":"< 2.11.43","status":"affected"},{"version":">= 3.0.0-beta1, < 3.6.14","status":"affected"},{"version":">= 3.7.0-ea.1, < 3.7.0-rc.2","status":"affected"}],"vendor":"traefik","product":"traefik","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1779786779","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces 3.28","package":"devspaces/traefik-rhel9","cpe":"cpe:/a:redhat:openshift_devspaces:3.28::el9","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"3.7.0-ea.1","status":"affected","fixed":"3.7.0-rc.2"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v3","purl":"pkg:golang/github.com/traefik/traefik/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0-beta1","status":"affected","fixed":"3.6.14"}],"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","fixed":"2.11.43"}],"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","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.43"}],"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.14"},{"type":"semver","introduced":"3.7.0-ea.1","status":"affected","fixed":"3.7.0-rc.2"}],"ecosystem":"Go","package":"github.com/traefik/traefik/v3","purl":"pkg:golang/github.com/traefik/traefik/v3","source":"go"},{"ranges":[{"status":"affected","fixed":"2.11.43"},{"status":"affected","introduced":"3.0.0","fixed":"3.6.14"},{"status":"affected","version":"3.7.0"},{"status":"affected","version":"3.7.0"},{"status":"affected","version":"3.7.0"},{"status":"affected","version":"3.7.0"}],"vendor":"traefik","product":"traefik","cpe":"cpe:2.3:a:traefik:traefik:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/traefik/traefik/security/advisories/GHSA-6jwx-7vp4-9847","tags":["advisory","exploit","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/traefik/traefik/releases/tag/v2.11.43","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/traefik/traefik/releases/tag/v3.6.14","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/traefik/traefik/releases/tag/v3.7.0-rc.2","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-40912","tags":["vdb-entry","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2464229","tags":["issue-tracking","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40912.json","tags":["web","x-sadp-csaf-vex"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:21772","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40912","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/traefik/traefik","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-05-01T14:53:15.470Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40912","url":"https://www.cve.org/CVERecord?id=CVE-2026-40912","licence":"CVE Terms of Use","modified":"2026-07-15T01:00:23.492Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6jwx-7vp4-9847","url":"https://github.com/advisories/GHSA-6jwx-7vp4-9847","licence":"CC-BY-4.0","modified":"2026-07-21T14:00:32.843Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5180","url":"https://pkg.go.dev/vuln/GO-2026-5180","licence":"CC-BY-4.0","modified":"2026-11-23T20:30:09.061Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40912","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40912","licence":"Public domain","modified":"2026-11-11T21:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:20.306Z","epss":{"score":0.00797,"percentile":0.57649,"date":"2026-12-01T12:00:22.000Z"}}