7.5

CVE-2022-31142: Potential Timing Attack Vector in @fastify/bearer-auth

Modified
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.56% chance of exploitation in the next 30 days, higher than 76% of scored vulnerabilities.

Priority
Prioritisesevere

Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 04-12-2026)

Source freshness unavailable

How is this decided?
CVSS score
7.5/10
010
High · v3.1 (CVE.org)
EPSS score
1.56%
0%100%
Low · +0.06 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware 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.56%

Chance of exploitation in the next 30 days

Percentile

76%

Versus all other CVEs

30-day change

Increase +0.06 pp

From 1.50% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

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