/

CVE-2026-40912

Severity:

HIGH RISK

(8.2)

Auth bypass via URL dot-segment handling in Traefik

CVE-2026-40912

Modified

Vulnerability type

Category:

Authentication Bypass via URL Normalization

CWE:

CWE-706, CWE-22

Impact:

Unauthorized Access to Protected Resources

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A flaw in Traefik's StripPrefixRegex middleware allows specially crafted URLs with dot-segments to bypass ForwardAuth, BasicAuth, or DigestAuth protections.

When backends normalize these dot-segment paths, unauthenticated attackers may gain access to routes that were intended to be restricted.

Affected context

This vulnerability arises in Traefik deployments that rely on StripPrefixRegex in front of authentication mechanisms such as ForwardAuth, BasicAuth, or DigestAuth.

It is most relevant when backend services normalize dot-segments in paths (e.g., treating /./admin/secret as /admin/secret) according to RFC 3986.

In such setups, mismatched path handling between Traefik and the backend can lead to protected routes being exposed under certain URL constructions.

Exploit preconditions

  • Attack surface: Publicly accessible HTTP endpoints served through Traefik where StripPrefixRegex is combined with an auth middleware.
  • Required access: Network access to send HTTP requests to the Traefik instance; no prior authentication required.
  • Trigger point: An HTTP request crafted so that the decoded path matches the StripPrefixRegex pattern, while the raw percent-encoded path includes dot-segments in the stripped prefix.
  • Why exploitation is possible: Traefik matches against the decoded path but slices the raw path by byte length, producing a dot-segment path (e.g., /./admin/secret) that the auth middleware does not treat as protected, while the backend later normalizes it to the actual protected route.

Why this happens

The core issue is an inconsistency in how different components handle and interpret URL paths, mapping to CWE-706: Use of Incorrectly Resolved Name or Reference and CWE-22: Path Traversal-style dot-segment normalization behavior.

Traefik's StripPrefixRegex middleware uses the decoded URL path for regex matching but then applies the computed prefix length to slice the percent-encoded raw path.

When dots appear in the prefix, the resulting raw path after stripping can become a dot-segment path (/./...) that is sent to authentication middleware as-is.

Since the auth middleware bases its protection patterns on straightforward paths while backends later normalize dot-segments per RFC 3986, the two components disagree about which routes are protected, enabling authentication bypass.

Potential impact

  • Unauthenticated users may gain access to administrative or internal application endpoints.
  • Attackers could read or modify sensitive data exposed on protected routes.
  • Security controls relying solely on Traefik authentication may be silently circumvented.
  • Misconfiguration could allow lateral movement into internal services behind Traefik.

General mitigation guidance

Mitigation generally focuses on aligning URL handling semantics across the reverse proxy, auth middleware, and backend services and minimizing ambiguity in path processing.

Recommended patterns include:

  • Ensuring that all components use consistent normalization rules for URL paths, especially regarding dot-segments.
  • Avoiding reliance on path prefix stripping for security boundaries where subtle parsing differences may appear.
  • Applying authentication checks on already-normalized paths or using explicit route-based protections instead of pattern-based prefix logic.
  • Reducing trust in user-controlled URL components and treating complex encodings or dot-segments as suspicious inputs.
  • Designing backends to enforce their own authorization checks even when fronted by a proxy, so that proxy misrouting cannot grant broad access.

How teams detect issues like this

Detection efforts can focus on identifying inconsistent path handling and unexpected access patterns:

  • Static analysis and configuration review to flag uses of StripPrefixRegex in combination with authentication middleware, especially where dot-segment paths might be produced.
  • Code review signals such as separate logic for decoded versus raw URL paths, or length-based slicing of encoded paths used for security-relevant routing.
  • Security tests that fuzz URLs with percent-encoding, dots, and path traversal-like segments to verify that authentication still applies.
  • Runtime monitoring for unusual access patterns, such as requests using /./ segments reaching endpoints that should be restricted.
  • Automated configuration scanners or policy enforcement tools that highlight ambiguous path normalization or mismatched protection rules between proxy and backend.

Sources

SourceLink
github.comgithub.com/traefik/traefik/releases/tag/v2.11.43
github.comgithub.com/traefik/traefik/releases/tag/v3.6.14
github.comgithub.com/traefik/traefik/releases/tag/v3.7.0-rc.2
github.comgithub.com/traefik/traefik/security/advisories/GHSA-6jwx-7vp4-9847
access.redhat.comaccess.redhat.com/errata/RHSA-2026:21772
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-40912
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2464229
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40912.json

Frequently asked

questions

Yes. Any unauthenticated user with network access to a Traefik instance configured with the affected middleware combination can attempt to exploit the issue using crafted HTTP requests.

Only the ability to send requests to the exposed Traefik endpoints is required; no prior login or special privileges are necessary, assuming the vulnerable configuration is present.

The safest approach is to ensure consistent URL normalization across proxy, auth middleware, and backend while avoiding security decisions based on ambiguous or partially processed paths. Authentication should be tied to clearly defined, normalized routes rather than relying on prefix stripping quirks.

Future systems should treat URL paths as untrusted input, normalize them once in a clearly documented manner, and apply authorization after normalization. Centralized routing and auth policies, defensive configuration reviews, and tests that cover encoded and dot-segmented paths help ensure that no alternate representations of protected routes bypass controls.

Find out what's already
exploitable in your codebase.