Low, CVSS 3.7PyPIAmendedPublished
FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection
CVE-2026-23996 · GHSA-95c6-p277-p87g
- Affected
- PyPI fastapi-api-key < 1.1.0
- Fixed in
- 1.1.0· Vendor fix available
- Issue
- Impact Timing side-channel vulnerability in verifykey(). The method applied a random delay only on verification failures, allowing an attacker to statistically distinguish valid from invalid API keys by measuring response latencies. With enough repeated requests, an adversary could infer whether a keyid corresponds to a valid key, potentially accelerating brute-force or enumeration attacks. Affected: all users relying on verifykey() for API key authentication prior to the fix. Patches Yes. Users should upgrade to version 1.1.0 (or the version containing this fix). The patch applies a uniform random delay (mindelay to maxdelay) to all responses regardless of outcome, eliminating the timing correlation. Workarounds - Add an application-level fixed delay or random jitter to all authentication responses (success and failure) before the fix is applied. - Use rate limiting to reduce the feasibility of statistical timing attacks. References - CWE-208: Observable Timing Discrepancy - Commit:…
Recommended action: Upgrade to 1.1.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.