Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/traefik/traefik/v2
  4. ›
  5. CVE-2026-40912

CVE-2026-40912: Traefik has an StripPrefixRegex Middleware Authorization Bypass via Path/RawPath Desync

April 24, 2026 (updated May 6, 2026)

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.

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 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.

References

  • github.com/advisories/GHSA-6jwx-7vp4-9847
  • github.com/traefik/traefik
  • github.com/traefik/traefik/releases/tag/v2.11.43
  • github.com/traefik/traefik/releases/tag/v3.6.14
  • github.com/traefik/traefik/releases/tag/v3.7.0-rc.2
  • github.com/traefik/traefik/security/advisories/GHSA-6jwx-7vp4-9847
  • nvd.nist.gov/vuln/detail/CVE-2026-40912

Code Behaviors & Features

Detect and mitigate CVE-2026-40912 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.11.43

Fixed versions

  • 2.11.43

Solution

Upgrade to version 2.11.43 or above.

Impact 8.2 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-706: Use of Incorrectly-Resolved Name or Reference

Source file

go/github.com/traefik/traefik/v2/CVE-2026-40912.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:17:59 +0000.