7.5

CVE-2022-31142: fastify bearer-auth Observable Timing Discrepancy

CVSS: 7.5v3.1HighModified
AliasesGHSA-376v-xgjx-7mfr
Published 14-07-2022Last modified 23-04-2025

Vulnerability summary

CVE-2022-31142 is a high (CVSS 7.5) Observable Timing Discrepancy vulnerability in fastify bearer-auth. EPSS estimates a 1.50% chance of exploitation in the next 30 days, higher than 73.8% of scored vulnerabilities.

Overall risk
30/100
0100
Medium · default modelHow is this calculated?
CVSS score
7.5/10
010
High · v3.1 (CVE.org)
EPSS score
1.50%
0%100%
Low · +0.04 pp in 30 days
KEVNot listedIn no KEV catalog
RansomwareNone recordedNo known use recorded
Public exploits0No public exploits recorded

Timeline

  1. 14-07-2022
    PublishedVulnerability first disclosed.
  2. 23-04-2025
    Last modifiedVulnerability information updated.

Description

@fastify/bearer-auth is a Fastify plugin to require bearer Authorization headers. @fastify/bearer-auth prior to versions 7.0.2 and 8.0.1 does not securely use crypto.timingSafeEqual. A malicious attacker could estimate the length of one valid bearer token. According to the corresponding RFC 6750, the bearer token has only base64 valid characters, reducing the range of characters for a brute force attack. Version 7.0.2 and 8.0.1 of @fastify/bearer-auth contain a patch. There are currently no known workarounds. The package fastify-bearer-auth, which covers versions 6.0.3 and prior, is also vulnerable starting at version 5.0.1. Users of fastify-bearer-auth should upgrade to a patched version of @fastify/bearer-auth.

CVSS metrics

3 scores · 3 sources · 1 version

EPSS trend

Probability

1.50%

Chance of exploitation in the next 30 days

Percentile

74%

Versus all other CVEs

30-day change

+0.04 pp

From 1.45% on 19-09-2026

19-09-202619-10-2026
EPSS score
1.50%

Known exploited

Compare KEV catalogs

Not in any of the 3 tracked catalogs.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Fastify2 products
@fastify1 product
  • bearer-auth< 7.0.2 | ≥ 8.0.0, < 8.0.1
Npm1 product
  • fastify-bearer-auth≥ 5.0.1, ≤ 6.0.3

3 vendors · 4 products

References

7 links