BreachSpiderVerified, not vibes

CVE-2023-31999 in Fastify Oauth2

High 8.8

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 ...

Affects 1 product from 1 vendor. Facts below cite their sources.

CVSS 3.18.8
EPSS0.7%
EPSS percentile51th
FixUnknown

Remotely exploitable over the network, low complexity, no authentication required, requires user interaction, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Fastify Oauth2 < 7.2.0

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official 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.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2023-31999
BreachSpider IDBS-2023-GLOBAL-002162-H
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Published2023-07-04
Last modified2026-06-17
Weakness (CWE)
SourceNVD

Weakness definitions

CWE-352: Cross-Site Request Forgery (CSRF)

Web application does not verify that a request was intentionally sent by the authenticated user.

Related attack patterns (CAPEC)

CAPEC-462 Cross-Domain Search Timing via CWE-352

CAPEC-467 Cross Site Identification via CWE-352

CAPEC-62 Cross Site Request Forgery via CWE-352

CAPEC-111 JSON Hijacking (aka JavaScript Hijacking) via CWE-352

Mapping is CWE to CAPEC per MITRE CAPEC 3.9.

Analysis AI-written, not human-reviewed

CVE-2023-31999 affects all versions of @fastify/oauth2 due to the use of a statically generated state parameter, which compromises the protection against Cross-Site-Request-Forgery (CSRF) attacks.

The vulnerability arises because the state parameter, which should be unique per user session to prevent CSRF, is instead statically generated and reused across all requests. This allows attackers to predict the state parameter and potentially perform CSRF attacks.

Questions

What is CVE-2023-31999?

CVE-2023-31999 affects all versions of @fastify/oauth2 due to the use of a statically generated state parameter, which compromises the protection against Cross-Site-Request-Forgery (CSRF) attacks.

What is the CVSS score for CVE-2023-31999?

CVE-2023-31999 has CVSS 8.8 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H. EPSS: 0.7%.

Is CVE-2023-31999 actively exploited?

No confirmed active exploitation of CVE-2023-31999 as of 2026-09-25.

How do I remediate CVE-2023-31999?

Priority: IMMEDIATE.

What systems are affected by CVE-2023-31999?

CVE-2023-31999 affects Fastify Oauth2.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Fastify","product":"Oauth2","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-06-17.