CVE-2022-31142

Summary

CVECVE-2022-31142
StatePUBLIC
Assigner[email protected]
Source PriorityCVE Program / NVD first with legacy fallback
Published2022-07-14 19:15:00 UTC
Updated2022-07-20 12:45:00 UTC
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.

Risk And Classification

Problem Types: CWE-203

NVD Known Affected Configurations (CPE 2.3)

TypeVendorProductVersionUpdateEditionLanguage
Application Fastify Bearer-auth All All All All
Application Fastify Bearer-auth 8.0.0 All All All

References

ReferenceSourceLinkTags
Merge pull request from GHSA-376v-xgjx-7mfr · fastify/fastify-bearer-auth@0c468a6 · GitHub MISC github.com
Merge pull request from GHSA-376v-xgjx-7mfr · fastify/fastify-bearer-auth@f921a05 · GitHub MISC github.com
HackerOne MISC hackerone.com
Potential Timing Attack Vector in fastify-bearer-auth · Advisory · fastify/fastify-bearer-auth · GitHub CONFIRM github.com
Use `crypto.timingSafeEqual()` instead of `secure-compare` module (#40) · fastify/fastify-bearer-auth@39353b1 · GitHub MISC github.com
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis
© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report