CVE-2026-23996
JSON

3.7low

FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection

Severity
3.7low CVSS:3.1 by GitHub_M
Exploit likelihood
0.29% (higher than 23% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-95c6-p277-p87gPYSEC-2026-1358

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.

Affected

Product or packageVersionsReported by
Athroniaeth fastapi-api-key< 1.1.0CVE List
fastapi-api-key (PyPI)before 1.1.0GitHub Advisory Database, PyPA Advisory Database
athroniaeth fastapi_api_keybefore 1.1.0NVD

All scores

GitHub_M3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHub3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
PyPA Advisory Database3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-208

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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.

Affected: all users relying on verify_key() 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 (min_delay to max_delay) 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
NVD (es)

FastAPI Api Key proporciona una librería agnóstica al backend que proporciona un sistema de claves API. La versión 1.1.0 tiene una vulnerabilidad de canal lateral de temporización en verify_key(). El método aplicó un retraso aleatorio solo en fallos de verificación, permitiendo a un atacante distinguir estadísticamente las claves API válidas de las inválidas midiendo las latencias de respuesta. Con suficientes solicitudes repetidas, un adversario podría inferir si un key_id corresponde a una clave válida, acelerando potencialmente los ataques de fuerza bruta o enumeración. Todos los usuarios que dependen de verify_key() para la autenticación de claves API antes de la corrección se ven afectados. Los usuarios deben actualizar a la versión 1.1.0 para recibir un parche. El parche aplica un retraso aleatorio uniforme (min_delay a max_delay) a todas las respuestas independientemente del resultado, eliminando la correlación de temporización. Hay disponibles algunas soluciones alternativas. Añadir un retraso fijo a nivel de aplicación o fluctuación aleatoria a todas las respuestas de autenticación (éxito y fallo) antes de que se aplique la corrección y/o usar la limitación de velocidad para reducir la viabilidad de los ataques de temporización estadísticos.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-23996 changed 2026-01-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-95c6-p277-p87g changed 2026-07-07CC-BY-4.0
NVDCVE-2026-23996 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-1358 changed 2026-07-07CC-BY-4.0