GHSA-95c6-p277-p87g

Suggest an improvement
Source
https://github.com/advisories/GHSA-95c6-p277-p87g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/01/GHSA-95c6-p277-p87g/GHSA-95c6-p277-p87g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-95c6-p277-p87g
Aliases
Published
2026-01-21T22:27:39Z
Modified
2026-01-22T15:53:49.677002Z
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 verifykey(). 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 keyid 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 (mindelay to maxdelay) 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
Database specific
{
    "cwe_ids": [
        "CWE-208"
    ],
    "severity": "LOW",
    "nvd_published_at": "2026-01-21T23:15:53Z",
    "github_reviewed": true,
    "github_reviewed_at": "2026-01-21T22:27:39Z"
}
References

Affected packages

PyPI / fastapi-api-key

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown 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/github/advisory-database/blob/main/advisories/github-reviewed/2026/01/GHSA-95c6-p277-p87g/GHSA-95c6-p277-p87g.json"