{"id":"CVE-2026-23996","aliases":["CVE-2026-23996","GHSA-95c6-p277-p87g","PYSEC-2026-1358"],"related":[],"kind":"vulnerability","state":"published","title":"FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nTiming 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.\n\nAffected: all users relying on verify_key() for API key authentication prior to the fix.\n\n### Patches\nYes. 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.\n\n### Workarounds\n- Add an application-level fixed delay or random jitter to all authentication responses (success and failure) before the fix is applied.\n- Use rate limiting to reduce the feasibility of statistical timing attacks.\n\n### References\n- CWE-208: Observable Timing Discrepancy\n- Commit: 87b27640f77c5ef86c46311b6b5a7e2887e35b77\n- OWASP: https://owasp.org/www-community/attacks/Timing_attack","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-01-21T22:27:39.000Z","modified":"2026-07-07T17:57:38.313Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"}],"cwes":["CWE-208"],"affected":[{"ranges":[{"version":"< 1.1.0","status":"affected"}],"vendor":"Athroniaeth","product":"fastapi-api-key","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"PyPI","package":"fastapi-api-key","purl":"pkg:pypi/fastapi-api-key","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.1.0"}],"vendor":"athroniaeth","product":"fastapi_api_key","cpe":"cpe:2.3:a:athroniaeth:fastapi_api_key:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"PyPI","package":"fastapi-api-key","purl":"pkg:pypi/fastapi-api-key","source":"pysec"}],"references":[{"url":"https://github.com/Athroniaeth/fastapi-api-key/security/advisories/GHSA-95c6-p277-p87g","tags":["mitigation","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/Athroniaeth/fastapi-api-key/commit/310b2c5c77305f38c63c0b917539a0344071dfd8","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/Athroniaeth/fastapi-api-key/releases/tag/1.1.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23996","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/Athroniaeth/fastapi-api-key","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/fastapi-api-key","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-95c6-p277-p87g","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-22T15:09:24.050Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23996","url":"https://www.cve.org/CVERecord?id=CVE-2026-23996","licence":"CVE Terms of Use","modified":"2026-01-22T16:49:16.733Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-95c6-p277-p87g","url":"https://github.com/advisories/GHSA-95c6-p277-p87g","licence":"CC-BY-4.0","modified":"2026-07-07T17:57:38.313Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23996","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23996","licence":"Public domain","modified":"2026-06-17T10:22:26.950Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1358","url":"https://osv.dev/vulnerability/PYSEC-2026-1358","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:35.926Z"}],"updatedAt":"2026-11-25T22:59:13.032Z","epss":{"score":0.00291,"percentile":0.23374,"date":"2026-12-01T12:00:22.000Z"}}