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

Low 3.7 Published Updated

Attackers can statistically detect valid API keys via timing side-channels in verify_key, facilitating brute-force attacks against FastAPI Api Key users.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-23996?

CVE-2026-23996 is a low-severity vulnerability in Athroniaeth fastapi-api-key, published on 21 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-208

Which versions are affected by CVE-2026-23996?

3 open source packages ship an affected version, including fastapi-api-key. It affects 1 product.

PackageAffectedFixed in
fastapi-api-key PyPIAll versions1.1.0
fastapi-api-key PyPIAll versions1.1.0
fastapi-api-key PyPIAll versions1.1.0

Products include Athroniaeth Fastapi Api Key.

How do I fix CVE-2026-23996?

Upgrade fastapi-api-key to 1.1.0 or later.

Is CVE-2026-23996 being exploited?

There is no known exploitation of CVE-2026-23996 in the wild and no public exploit code.

Sources

Also known as GHSA-95c6-p277-p87g, PYSEC-2026-1358.

Is CVE-2026-23996 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free