Vulnerabilities in pkg:pypi/fastapi-api-key

PACKAGE
Advisory Identifier: GHSA-95c6-p277-p87g
Advisory Summary

CVE-2026-23996 is a LOW (CVSS 3.7) fastapi api key has a vulnerability (CWE-208: Observable Timing Discrepancy) affecting Fastapi api key libraries in the PyPI ecosystem. The issue involves fastapi api key has a timing side-channel in verify_key that allows statistical key validity detection. Remediation is available by upgrading affected packages to version 1.1.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/fastapi-api-key

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/fastapi-api-key. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-95c6-p277-p87g CVE-2026-23996 LOW FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection

CVE-2026-23996 at a Glance

CVE Identifier CVE-2026-23996
GHSA Identifier GHSA-95c6-p277-p87g
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-208: Observable Timing Discrepancy
Affected Product Fastapi api key
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-23996

To remediate this vulnerability, upgrade all affected Fastapi api key dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

fastapi-api-key fixed: 1.1.0
pip install fastapi-api-key>=1.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show fastapi-api-key

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-23996, inspect your installed packages using pip:

pip show fastapi-api-key

Analyze the terminal output to locate any version of Fastapi api key in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.

Note: The pip show fastapi-api-key command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-208: Observable Timing Discrepancy, where two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not. In Fastapi api key, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 - CWE-208: Observable Timing Discrepancy - Commit: 87b27640f77c5ef86c46311b6b5a7e2887e35b77 - OWASP: https://owasp.org/www-community/attacks/Timing_attack

CVE-2026-23996 Affected Fastapi api key Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
fastapi-api-key
PyPI
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2026-23996?
CVE-2026-23996 is a security vulnerability in Fastapi api key involving FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection under CWE-208: Observable Timing Discrepancy.
Which Fastapi api key versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: fastapi-api-key.
What version fixes CVE-2026-23996?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is fastapi-api-key affected?
Yes, fastapi-api-key is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2026-23996?
CVE-2026-23996 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-23996?
CVE-2026-23996 is classified under CWE-208: Observable Timing Discrepancy (Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.).
How can I check PyPI dependencies for CVE-2026-23996?
Run the dependency tree command: 'pip show fastapi-api-key'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-95c6-p277-p87g",
  "modified" : "2026-01-22T15:40:29Z",
  "published" : "2026-01-21T22:27:39Z",
  "aliases" : [ "CVE-2026-23996" ],
  "summary" : "FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection",
  "details" : "### 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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "fastapi-api-key"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Athroniaeth/fastapi-api-key/security/advisories/GHSA-95c6-p277-p87g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-23996"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Athroniaeth/fastapi-api-key/commit/310b2c5c77305f38c63c0b917539a0344071dfd8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Athroniaeth/fastapi-api-key"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Athroniaeth/fastapi-api-key/releases/tag/1.1.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-208" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-21T22:27:39Z",
    "nvd_published_at" : "2026-01-21T23:15:53Z"
  }
}