
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-23996 is a timing side-channel vulnerability in the fastapi-api-key Python library (also known as keyshield) that allows unauthenticated remote attackers to statistically distinguish valid from invalid API keys by measuring response latencies. The flaw exists in the verify_key() method, which applied a random delay only on verification failures — not on successes — creating an observable timing discrepancy. All versions of fastapi-api-key prior to 1.1.0 are affected. The vulnerability was published on January 21, 2026, with a patch released the same day. It carries a CVSS v3.1 base score of 3.7 (Low) (GitHub Advisory).
The root cause is classified as CWE-208 (Observable Timing Discrepancy). In the vulnerable implementation, verify_key() wrapped only the exception path with a randomized sleep (uniform(rrd, rrd * 2)), meaning successful authentications returned faster than failures. An attacker with network access could send repeated requests with candidate key_id values and use statistical analysis of response times to infer whether a given key identifier is valid, effectively enabling key enumeration without triggering a full brute-force of the secret portion. The fix (commit 310b2c5) introduces a _apply_delay() helper that calls asyncio.sleep(uniform(min_delay, max_delay)) unconditionally on both success and failure paths, and deprecates the old rrd parameter in favor of explicit min_delay/max_delay arguments (GitHub Advisory, Patch Commit).
Successful exploitation leaks low-confidence confidentiality information: an attacker can determine whether a given key_id corresponds to a registered API key, narrowing the search space for brute-force or enumeration attacks against the authentication system. There is no direct integrity or availability impact. The practical risk is that an adversary could accelerate credential-guessing campaigns against APIs protected by this library, potentially leading to unauthorized access if combined with further attacks (GitHub Advisory).
No public exploit code or in-the-wild exploitation has been reported for this vulnerability. The EPSS score is approximately 0.038% (0.000380), placing it in the 20th percentile for exploitation likelihood within 30 days. The attack complexity is rated High, as statistical timing attacks require a large number of repeated requests and controlled network conditions to yield reliable results. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog (GitHub Advisory).
fastapi-api-key library (versions < 1.1.0) by inspecting API responses, error messages, or dependency manifests (e.g., requirements.txt, PyPI metadata).key_id values (the public identifier portion of an API key) against the authentication endpoint protected by verify_key().key_id, recording precise response times using a high-resolution timer. Requests with valid key_id values will consistently return faster (no injected delay), while invalid ones will include the random delay.key_id values from invalid ones based on the timing distribution.key_id values to focus brute-force or guessing efforts on the secret portion of the API key, reducing the overall search space (GitHub Advisory).key_id values but consistent request structure.KeyNotFound or InvalidKey errors in rapid succession from the same source, potentially interleaved with occasional successes; unusual patterns of requests cycling through many different key identifiers.Users should upgrade fastapi-api-key to version 1.1.0, which applies a uniform random delay (min_delay to max_delay, defaulting to 0.1–0.3 seconds) to all verify_key() responses regardless of outcome, eliminating the timing correlation. For those unable to upgrade immediately, two workarounds are available: (1) add an application-level fixed delay or random jitter to all authentication responses (both success and failure) before the library's response is returned; and (2) implement rate limiting on authentication endpoints to reduce the feasibility of statistical timing attacks. The rrd parameter is deprecated in v1.1.0 and replaced by the explicit min_delay/max_delay parameters (GitHub Advisory, Release 1.1.0).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."