{"id":"CVE-2022-31142","published":"2022-07-14T18:55:11Z","modified":"2025-04-23T18:02:16Z","title":"Potential Timing Attack Vector in @fastify/bearer-auth","vendor":"fastify","product":"fastify-bearer-auth","tier":"tail","description":{"text":"@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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01545,"percentile":0.75278,"provenance":"source"},"cwes":[{"id":"CWE-208","name":"Observable Timing Discrepancy"}],"references":[{"url":"https://github.com/fastify/fastify-bearer-auth/security/advisories/GHSA-376v-xgjx-7mfr","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/fastify/fastify-bearer-auth/commit/0c468a616d7e56126dc468150f6a5a92e530b8e4","tags":["x_refsource_MISC"]},{"url":"https://github.com/fastify/fastify-bearer-auth/commit/39353b15409ee99474545f615ffb16180cf3b716","tags":["x_refsource_MISC"]},{"url":"https://github.com/fastify/fastify-bearer-auth/commit/f921a0582dc83112039004a9b5041141b50c5b3f","tags":["x_refsource_MISC"]},{"url":"https://hackerone.com/reports/1633287","tags":["x_refsource_MISC"]}],"priority":{"score":20.3,"factors":[{"name":"EPSS percentile","points":15.06},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"fastify","affectedVersions":[{"vendor":"fastify","product":"fastify-bearer-auth","versions":[">= 5.0.1, < 7.0.2","= 8.0.0"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-23T15:53:32.961418Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"fastify-bearer-auth","vulnerableRanges":[">=5.0.1, <=6.0.3"],"patched":[],"from":["GHSA-376v-xgjx-7mfr"],"provenance":"source"},{"ecosystem":"npm","package":"@fastify/bearer-auth","vulnerableRanges":["<7.0.2",">=8.0.0, <8.0.1"],"patched":["7.0.2","8.0.1"],"from":["GHSA-376v-xgjx-7mfr"],"provenance":"source"}],"summary":{"text":"The @fastify/bearer-auth Fastify plugin, which requires bearer Authorization headers, does not securely use crypto.timingSafeEqual, and the older fastify-bearer-auth package is affected as well. A remote, unauthenticated attacker with network access and no user interaction can estimate the length of a valid bearer token through timing differences and then brute-force the token, narrowed by the base64 character set, to gain unauthorized confidentiality impact.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:15:01Z"},"euvd":{"id":"EUVD-2022-6214","exploited":false,"provenance":"source"}}