Skip to content
Heist/ feed
Back to feed
Low

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-23996
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 15:07 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 21 Jan 2026, 22:29 UTC

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.

osv:CVE-2026-23996
Complete source record
{
  "id": "8831967ff6460ea521e64c2559752cbb635956ac0982aea600d3fa58f5e2b3bd",
  "url": "https://osv.dev/vulnerability/CVE-2026-23996",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "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.",
    "evidence": "osv:CVE-2026-23996",
    "products": [],
    "severity": "low",
    "structured": {
      "id": "CVE-2026-23996",
      "aliases": [
        "CVE-2026-23996",
        "GHSA-95c6-p277-p87g",
        "PYSEC-2026-1358"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/Athroniaeth/keyshield",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "87b27640f77c5ef86c46311b6b5a7e2887e35b77"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.1.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.0.0",
            "0.13.3",
            "0.13.2",
            "0.13.1",
            "0.13.0",
            "0.10.0",
            "0.8.2",
            "0.8.1",
            "0.8.0",
            "0.7.3",
            "0.7.2",
            "0.7.1",
            "0.6.0",
            "0.4.0",
            "0.2.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-23996.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:29.984507134Z",
      "provider": "osv",
      "references": [
        "https://github.com/Athroniaeth/fastapi-api-key/releases/tag/1.1.0",
        "https://github.com/Athroniaeth/fastapi-api-key/security/advisories/GHSA-95c6-p277-p87g",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23996.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-23996",
        "https://github.com/Athroniaeth/fastapi-api-key/commit/310b2c5c77305f38c63c0b917539a0344071dfd8"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-208"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23996.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-23996",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 496666,
  "published_at": "2026-01-21T22:29:24.107+00:00"
}