{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-31142","id":"CVE-2022-31142","title":"Potential Timing Attack Vector in @fastify/bearer-auth","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 ","descriptionLong":"@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.","published":"2022-07-14T18:55:11.000Z","updated":"2026-10-28T02:30:31.266536094Z","reserved":"2022-05-18T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"high","source":"NVD"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"high","source":"OSV"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"high","source":"GitHub"}],"rating":"high","products":["fastify-bearer-auth"],"affectedProducts":[{"vendor":"fastify","product":"fastify-bearer-auth","defaultStatus":null,"versions":[{"status":"affected","version":">= 5.0.1, < 7.0.2"},{"status":"affected","version":"= 8.0.0"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"fastify-bearer-auth","purl":"pkg:npm/fastify-bearer-auth","ranges":[">=5.0.1 <=6.0.3"],"fixed":[],"advisory":"GHSA-376v-xgjx-7mfr"},{"ecosystem":"npm","name":"@fastify/bearer-auth","purl":"pkg:npm/%40fastify/bearer-auth","ranges":["<7.0.2",">=8.0.0 <8.0.1"],"fixed":["7.0.2","8.0.1"],"advisory":"GHSA-376v-xgjx-7mfr"}],"cwes":["CWE-208","CWE-203"],"aliases":["GHSA-376v-xgjx-7mfr"],"references":[{"url":"https://github.com/fastify/fastify-bearer-auth/security/advisories/GHSA-376v-xgjx-7mfr","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/fastify/fastify-bearer-auth/commit/0c468a616d7e56126dc468150f6a5a92e530b8e4","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/fastify/fastify-bearer-auth/commit/39353b15409ee99474545f615ffb16180cf3b716","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/fastify/fastify-bearer-auth/commit/f921a0582dc83112039004a9b5041141b50c5b3f","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://hackerone.com/reports/1633287","tags":["x_refsource_MISC","x_transferred","Permissions Required","Third Party Advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31142.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31142","tags":["advisory"]},{"url":"https://github.com/fastify/fastify-bearer-auth","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial"},"epss":0.01532,"epssPercentile":0.75416,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-31142","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31142","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-31142","ok":true,"note":"2 packages"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-376v-xgjx-7mfr","ok":true,"note":"GHSA-376v-xgjx-7mfr"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-31142","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}