FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-208.
Summary
FastAPI Api Key provides a backend-agnostic library that provides an API key system. Version 1.1.0 has a timing side-channel vulnerability in verify_key(). 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 key_id corresponds to a valid key, potentially accelerating brute-force or enumeration attacks. All users relying on verify_key() for API key authentication prior to the fix are affected. Users should upgrade to version 1.1.0 to receive a patch. The patch applies a uniform random delay (min_delay to max_delay) to all responses regardless of outcome, eliminating the timing correlation. Some workarounds are available. Add an application-level fixed delay or random jitter to all authentication responses (success and failure) before the fix is applied and/or use rate limiting to reduce the feasibility of statistical timing attacks.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Athroniaeth | fastapi-api-key | before 1.1.0 | 1.1.0 | Patch available | CNA |
| — | fastapi-api-key (PyPI) | before 1.1.0 | 1.1.0 | Patch available | GHSA-95c6-p277-p87g |
- fastapi-api-key VendorAthroniaeth Affected before 1.1.0 Fixed in 1.1.0 Patch available CNA
- fastapi-api-key (PyPI) Vendor— Affected before 1.1.0 Fixed in 1.1.0 Patch available GHSA-95c6-p277-p87g
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:athroniaeth:fastapi_api_key:*:*:*:*:*:python:*:* | before 1.1.0 | Vulnerable | Athroniaeth |
- cpe:2.3:a:athroniaeth:fastapi_api_key:*:*:*:*:*:python:*:* Versions before 1.1.0 Vulnerable ·Athroniaeth
Remediation
- Fix · CNA fastapi-api-key (Athroniaeth) Fixed in 1.1.0
- Fix · GHSA-95c6-p277-p87g fastapi-api-key (PyPI) Fixed in 1.1.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-23996
- 2026-10-03 Alias added: GHSA-95c6-p277-p87g
References
Patch 2
Sources
- CVE-2026-23996 · CVE Program
- CVE-2026-23996 · NVD
- FIRST EPSS
- GHSA-95c6-p277-p87g · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences