Mar 20, 2026·6 min read·22 visits
Traefik's BasicAuth middleware is vulnerable to a timing attack (CWE-208) due to an early exit optimization. Unauthenticated attackers can enumerate valid usernames by measuring response times, as valid users trigger expensive bcrypt operations while invalid users return immediately.
CVE-2026-32595 is an observable timing discrepancy vulnerability in Traefik's BasicAuth middleware affecting versions across the 2.x and 3.x branches. The flaw allows unauthenticated remote attackers to enumerate valid user accounts by measuring the server's response time during authentication attempts.
Traefik operates as a modern HTTP reverse proxy and load balancer, frequently serving as the primary ingress controller for containerized environments. The BasicAuth middleware is a core component used to restrict access to backend services using standard HTTP Basic Authentication. CVE-2026-32595 identifies a structural flaw in how this middleware processes incoming credentials, specifically categorized as CWE-208 (Observable Timing Discrepancy).
The vulnerability manifests during the credential validation phase when the middleware queries its configured user store. The implementation prioritizes performance by immediately returning an unauthorized status if the submitted username is absent from the backend store. This architectural decision inadvertently introduces a side-channel vulnerability that exposes the internal state of the user database to unauthorized actors.
Unauthenticated remote attackers can leverage this observable timing discrepancy to perform username enumeration. By systematically transmitting authentication requests and measuring the precise response latency, an attacker can definitively categorize usernames as valid or invalid. This capability compromises the confidentiality of the system's identity store and establishes a foundation for subsequent targeted attacks.
The root cause of CVE-2026-32595 lies in an early exit optimization within the credential verification logic of the BasicAuth middleware. When Traefik processes an Authorization: Basic header, it extracts the decoded username and queries the backend user store. If the query returns no result, the middleware aborts the authentication sequence and immediately issues a 401 Unauthorized HTTP response.
Conversely, if the username exists within the store, the middleware retrieves the corresponding password hash. Traefik utilizes the bcrypt hashing algorithm, which incorporates a configurable cost factor designed specifically to consume CPU cycles and deter brute-force attacks. The execution of bcrypt.CompareHashAndPassword imposes a deterministic cryptographic delay on the request thread.
This divergent execution path creates a massive, network-observable timing discrepancy. Testing indicates that an immediate rejection requires approximately 0.6 milliseconds of processing time, while the bcrypt verification path consumes roughly 166.5 milliseconds. This ~298x latency multiplication effectively neutralizes the network jitter that typically complicates remote timing attacks, making the vulnerability highly reliable.
To eliminate the timing side-channel, the vulnerable execution path requires normalization to ensure that all authentication attempts consume a statistically similar amount of processing time. The structural fix necessitates the removal of the early exit condition.
The patched implementation introduces a "dummy" bcrypt comparison operation that executes exclusively when the requested username is not found in the backend store. When a request for an invalid user arrives, the middleware retrieves a pre-computed, static bcrypt hash and performs the CompareHashAndPassword operation against the user-supplied password. This forces the application to incur the exact same computational penalty regardless of user existence.
While this remediation strategy successfully neutralizes the timing discrepancy, it introduces a secondary consideration regarding resource consumption. Attackers can now reliably trigger expensive bcrypt operations without needing valid usernames, potentially facilitating asymmetric denial-of-service (DoS) conditions. Deployments must implement robust rate-limiting controls upstream of the authentication middleware to mitigate this associated risk.
Exploitation of CVE-2026-32595 requires an attacker to send a series of crafted HTTP requests to a Traefik-protected endpoint and meticulously record the response latencies. The methodology relies on statistical aggregation to eliminate anomalous network delays. An attacker typically transmits multiple requests for a single target username and calculates the median response time to establish a reliable baseline.
The provided proof-of-concept script demonstrates this technique using Python's requests library and precise timing functions. The script issues 20 sequential authentication attempts per username, capturing the elapsed time for each round trip. By utilizing the median value across these samples, the script effectively filters out transient latency spikes caused by network routing fluctuations or temporary server load.
When executed against a vulnerable instance, the exploit yields a binary categorization based on a predefined latency threshold. Valid usernames consistently return medians exceeding 50 milliseconds due to the bcrypt execution, while invalid usernames cluster tightly around the 1-millisecond mark. This stark contrast permits automated, high-throughput enumeration tools to rapidly harvest valid accounts without generating excessive authentication failures.
# Core exploit logic from PoC
def measure_time(username, password="wrongpassword"):
times = []
for _ in range(SAMPLES):
start = time.perf_counter()
requests.get(TARGET, auth=(username, password), timeout=5)
elapsed = time.perf_counter() - start
times.append(elapsed)
return statistics.median(times)The primary security impact of CVE-2026-32595 is the unauthorized disclosure of identity information. Username enumeration represents a critical reconnaissance phase in the cyber kill chain, allowing threat actors to map the valid account space of a target organization. This disclosure fundamentally undermines the principle of least privilege by exposing internal naming conventions and administrative account structures.
Once a verified list of usernames is compiled, the attacker's operational efficiency increases exponentially. The adversary can transition from blind attacks to targeted credential stuffing or password spraying campaigns. By restricting subsequent authentication attempts strictly to known-valid accounts, attackers minimize the overall volume of requests, thereby reducing the probability of triggering account lockout mechanisms or alerting security monitoring systems.
The vulnerability carries a CVSS 4.0 base score of 6.3 (Medium), reflecting its role as an enabler rather than a direct vector for system compromise. The Exploit Prediction Scoring System (EPSS) rating of 0.00036 indicates a low probability of immediate, widespread exploitation. However, in environments where BasicAuth guards critical administrative interfaces, the reliable identification of valid user accounts presents a severe risk to organizational security posture.
The definitive remediation for CVE-2026-32595 is upgrading the Traefik deployment to a patched release. The vendor has backported the structural fix across multiple supported branches. Administrators must deploy version 2.11.41, 3.6.11, or 3.7.0-ea.2 depending on their current release train. These versions incorporate the dummy bcrypt comparison logic, effectively neutralizing the timing side-channel.
In environments where immediate patching is administratively prohibited, security teams must deploy compensating controls. Implementing strict rate-limiting on endpoints protected by the BasicAuth middleware significantly increases the time required to perform enumeration. The Traefik RateLimit middleware can be configured to throttle requests based on the client IP address, degrading the feasibility of large-scale timing attacks.
Furthermore, organizations should actively monitor authentication logs for behavioral anomalies indicative of timing attacks. Security Information and Event Management (SIEM) rules should generate alerts for high volumes of authentication failures originating from a single source address, particularly if the attempts iterate systematically through varied usernames. Transitioning away from Basic Authentication toward robust identity providers utilizing multi-factor authentication (MFA) remains the optimal long-term defense strategy.
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Traefik Traefik | <= 2.11.40 | 2.11.41 |
Traefik Traefik | >= 3.0.0-beta1, <= 3.6.10 | 3.6.11 |
Traefik Traefik | 3.7.0-ea.1 | 3.7.0-ea.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-208 |
| Attack Vector | Network (AV:N) |
| CVSS v4.0 | 6.3 (Medium) |
| EPSS Score | 0.00036 |
| Impact | Username Enumeration |
| Exploit Status | Proof of Concept (PoC) |
| KEV Status | Not Listed |
Observable Timing Discrepancy
A Server-Side Request Forgery (SSRF) vulnerability exists in the Ghost content management system from version 6.0.9 up to, but not including, 6.21.1. The flaw resides in the 'request-external.js' module, where the IP address validation blocklist fails to account for fully expanded IPv4-mapped IPv6 formats. This allows unauthenticated remote attackers to bypass the private IP filter and initiate unauthorized connections to loopback services, internal subnets, or cloud instance metadata endpoints.
Ghost CMS is vulnerable to Server-Side Request Forgery (SSRF) in versions 6.0.9 through 6.21.1. Due to a Time-of-Check to Time-of-Use (TOCTOU) race condition in its outbound fetch validation logic, an attacker can bypass IP blocklists via DNS Rebinding. This allows unauthorized interaction with private networks and local services.
A Server-Side Request Forgery (SSRF) vulnerability exists in the Mobiledoc post-rendering component of Ghost CMS versions 6.19.4 through 6.21.0. This allows authenticated staff users with post creation or editing privileges to force the application server to perform arbitrary outbound HTTP GET requests, targeting internal endpoints, local loopback interfaces, or cloud metadata endpoints.
An authenticated staff-level user can perform a side-channel, boolean-based blind database query attack through the Ghost Admin API to systematically extract the hashed passwords (bcrypt) of other staff users, including administrators, due to insecure filter mapping.
A comprehensive technical analysis of CVE-2026-70591, a Server-Side Request Forgery (SSRF) vulnerability identified in the Ghost Content Management System. The flaw resides in the server-side image fetching mechanism of the ImageSize class, which allows authenticated, staff-level users to force the backend to perform unvalidated HTTP GET requests targeting local or private network services. This report provides an in-depth exploration of the root cause, vulnerable code structures, patch implementations, and mitigation steps.
A path traversal vulnerability (CWE-22) in Ghost CMS versions 1.20.1 through 6.54.0 allows authenticated administrators to escape the backup directory and perform arbitrary file write operations on the hosting system. This vulnerability was resolved in version 6.54.1.