{"cve":"CVE-2022-31142","nvd":{"published":"2022-07-14T19:15:07.787","modified":"2026-06-17T04:44:53.493","status":"Modified","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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5},"cwes":["CWE-203","CWE-208"],"references":["https://github.com/fastify/fastify-bearer-auth/commit/0c468a616d7e56126dc468150f6a5a92e530b8e4","https://github.com/fastify/fastify-bearer-auth/commit/39353b15409ee99474545f615ffb16180cf3b716","https://github.com/fastify/fastify-bearer-auth/commit/f921a0582dc83112039004a9b5041141b50c5b3f","https://github.com/fastify/fastify-bearer-auth/security/advisories/GHSA-376v-xgjx-7mfr","https://hackerone.com/reports/1633287"],"products":["fastify:bearer-auth"],"source":"nvd","synced_at":"2026-10-19T21:33:44.859608815+00:00"},"epss":{"cve":"CVE-2022-31142","score":0.01496,"percentile":0.74192,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-376v-xgjx-7mfr","url":"https://osv.dev/vulnerability/GHSA-376v-xgjx-7mfr","summary":"fastify-bearer-auth vulnerable to Timing Attack Vector","modified":"2023-11-08T04:09:27.360758Z","packages":[{"ecosystem":"npm","name":"fastify-bearer-auth","purl":"pkg:npm/fastify-bearer-auth","ranges":[">=5.0.1 <=6.0.3"],"fixed":[]},{"ecosystem":"npm","name":"@fastify/bearer-auth","purl":"pkg:npm/%40fastify/bearer-auth","ranges":["<7.0.2"],"fixed":["7.0.2"]},{"ecosystem":"npm","name":"@fastify/bearer-auth","purl":"pkg:npm/%40fastify/bearer-auth","ranges":[">=8.0.0 <8.0.1"],"fixed":["8.0.1"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}