{"cve":"CVE-2023-31999","nvd":{"published":"2023-07-04T17:15:10.657","modified":"2026-06-17T05:57:48.990","status":"Modified","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.\r\n\r\nv7.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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":8.8},"cwes":["CWE-352"],"references":["https://auth0.com/docs/secure/attack-protection/state-parameters","https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0","https://hackerone.com/reports/2020418","https://auth0.com/docs/secure/attack-protection/state-parameters","https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0"],"products":["fastify:oauth2"],"source":"nvd","synced_at":"2026-10-19T21:38:30.124994567+00:00"},"epss":{"cve":"CVE-2023-31999","score":0.00705,"percentile":0.53353,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-g8x5-p9qc-cf95","url":"https://osv.dev/vulnerability/GHSA-g8x5-p9qc-cf95","summary":"@fastify/oauth2 vulnerable to Cross Site Request Forgery due to reused Oauth2 state","modified":"2023-11-08T04:12:32.265455Z","packages":[{"ecosystem":"npm","name":"@fastify/oauth2","purl":"pkg:npm/%40fastify/oauth2","ranges":["<7.2.0"],"fixed":["7.2.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}