PYSEC-2026-1358

See a problem?
Import Source
https://github.com/pypa/advisory-database/blob/main/vulns/fastapi-api-key/PYSEC-2026-1358.yaml
JSON Data
https://api.osv.dev/v1/vulns/PYSEC-2026-1358
Aliases
Published
2026-07-07T16:03:19Z
Modified
2026-07-07T17:47:35Z
Severity
  • 3.7 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N CVSS Calculator
Summary
FastAPI Api Key has a timing side-channel in verify_key that allows statistical key validity detection
Details

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

References

Affected packages

PyPI / fastapi-api-key

Package

Name
fastapi-api-key
View open source insights on deps.dev
Purl
pkg:pypi/fastapi-api-key

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.1.0

Affected versions

0.*
0.2.1
0.3.0
0.4.0
0.5.0
0.6.0
0.7.1
0.7.2
0.7.3
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.10.0
0.11.0
0.12.0
0.13.0
0.13.1
0.13.2
0.13.3
1.*
1.0.0

Database specific

source
"https://github.com/pypa/advisory-database/blob/main/vulns/fastapi-api-key/PYSEC-2026-1358.yaml"