cve.bz

CVE-2022-31142

7.5 highEPSS 1.5%

High (7.5) in fastify bearer-auth. EPSS 1.5% chance of exploitation in the next 30 days. Fixed in @fastify/bearer-auth 7.0.2, 8.0.1.

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

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS
1.5% chance of exploitation in the next 30 days; higher than 74% of CVEs (scores of 2026-10-31)
CWEs
CWE-203, CWE-208
Published
Modified
Record from
the NVD, synced

Affected

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-376v-xgjx-7mfrnpmfastify-bearer-auth>=5.0.1 <=6.0.3no fix published
GHSA-376v-xgjx-7mfrnpm@fastify/bearer-auth<7.0.27.0.2
GHSA-376v-xgjx-7mfrnpm@fastify/bearer-auth>=8.0.0 <8.0.18.0.1

References

Check your stackJSON