CVE-2023-31999: fastify oauth2 Cross-Site Request Forgery (CSRF)
Vulnerability summary
CVE-2023-31999 is a high (CVSS 8.8) Cross-Site Request Forgery (CSRF) vulnerability in fastify oauth2. EPSS estimates a 0.70% chance of exploitation in the next 30 days, higher than 52.5% of scored vulnerabilities. 1 public exploit is recorded.
Advisory lineage
Upstream 0 · Downstream 0 · Duplicates 1Timeline
- 04-07-2023PublishedVulnerability first disclosed.
- 26-11-2024Last modifiedVulnerability information updated.
Description
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.
CVSS metrics
2 scores · 2 sources · 1 version- OSV · NpmEcosystem advisory · calculated7.4HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:NDiffers
EPSS trend
Probability
0.70%
Chance of exploitation in the next 30 days
Percentile
53%
Versus all other CVEs
30-day change
0.00 pp
From 0.70% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundExploit Reference (auth0.com)
Maturity: unknown
Weaknesses
CWE · root causeAffected systems
@fastify1 product
- oauth2< 7.2.0
Fastify1 product
- oauth2< 7.2.0
Npm1 product
- @fastify/oauth2≥ v7.2.0, < v7.2.0
3 vendors · 3 products
References
7 links- hackerone.com/reports/2020418Permissions Required