Advisory

GHSA-376v-xgjx-7mfr

Also known as: CVE-2022-31142

Summary

fastify-bearer-auth vulnerable to Timing Attack Vector

Details

Impact

fastify-bearer-auth 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.

All versions of fastify-bearer-auth are also affected.

Patches

We released:

  • v8.0.1 with a fix for the Fastify v4 line
  • v7.0.2 with a fix for the Fastify v3 line

Workarounds

There are no workarounds. Update your dependencies.

References

https://hackerone.com/reports/1633287

For more information
If you have any questions or comments about this advisory:

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-07-15 19:14 UTC
Modified
2023-11-08 04:09 UTC

Affected packages and fixes

fastify-bearer-auth

npm · All systems

Affected

  • introduced 5.0.1, last affected 6.0.3 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

@fastify/bearer-auth

npm · All systems

Affected

  • introduced 0, fixed 7.0.2 (semver)

Fixed versions

7.0.2

Fix

@fastify/bearer-auth

npm · All systems

Affected

  • introduced 8.0.0, fixed 8.0.1 (semver)

Fixed versions

8.0.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences