Live threats

All CVEs / Fastify

CVE-2023-31999Fastify Oauth2

High 8.8 No auth needed

Priority
68
CVSS 3.1
8.8
EPSS
0.7%
probability of exploitation in 30 days · percentile 51
Auth required
No
Published
Jul 4, 2023
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-352
SSVC (CISA)
Exploitation: proof of concept · Automatable: no · Technical impact: total
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

What happens

All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all requests for all users. The purpose of the Oauth2 state parameter is to prevent Cross-Site-Request-Forgery attacks. As such, it should be unique per user and should be connected to the user's session in some way that will allow the server to validate it. v7.2.0 changes the default behavior to store the state in a cookie with the http-only and same-site=lax attributes set. The state is now by default generated for every user. Note that this contains a breaking change in the checkStateFunction function, which now accepts the full Request object.

Original NVD text.

What to do

  1. Apply the vendor's security update for Oauth2.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
npm @fastify/oauth2 < 7.2.0 7.2.0 npm install @fastify/oauth2@7.2.0

Per OSV / GitHub Advisories (GHSA-g8x5-p9qc-cf95). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
fastifyoauth2< 7.2.0

Official sources

References

Links published by the sources. Open them with care.