{"schemaVersion":3,"id":"CVE-2023-31999","aliases":["GHSA-g8x5-p9qc-cf95"],"status":"published","duplicateOf":null,"title":null,"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.\n\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.","dates":{"published":"2023-07-04T16:29:20.281Z","modified":"2024-11-26T18:47:25.202Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"OSV · Npm","score":7.4,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","exploitability":7.2,"impact":6.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":8.8,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00705,"percentile":0.52518,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.00705},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00705,"percentile":0.52518}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00705,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00705,"percentile":0.52518}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_0EEDB715EAAC6374","name":"Exploit Reference (auth0.com)","source":"reference","url":"https://auth0.com/docs/secure/attack-protection/state-parameters","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-352","name":"Cross-Site Request Forgery (CSRF)","description":"The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.","type":"weakness","status":"Stable","abstraction":"Compound","likelihoodOfExploit":"Medium","url":"https://cwe.mitre.org/data/definitions/352.html"}],"affected":[{"vendor":"fastify","product":"oauth2","name":"oauth2","label":"oauth2","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 7.2.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 7.2.0","eol":null,"hubHref":"/vendor/fastify/oauth2"},{"vendor":"@fastify","product":"oauth2","name":"@fastify/oauth2","label":"oauth2","ecosystem":"Npm","cpePart":null,"purl":"pkg:npm/@fastify/oauth2","purlType":"npm","versions":[{"text":"< 7.2.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 7.2.0","eol":null,"hubHref":null},{"vendor":"npm","product":"@fastify/oauth2","name":"@fastify/oauth2","label":"@fastify/oauth2","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ v7.2.0, < v7.2.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ v7.2.0, < v7.2.0","eol":null,"hubHref":"/vendor/npm/fastifyoauth2"}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://hackerone.com/reports/2020418","label":"hackerone.com/reports/2020418","hostname":"hackerone.com","tags":["Permissions Required"]},{"url":"https://auth0.com/docs/secure/attack-protection/state-parameters","label":"auth0.com/docs/secure/attack-protection/state-parameters","hostname":"auth0.com","tags":["WEB","Exploit"]},{"url":"https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0","label":"github.com/fastify/fastify-oauth2/releases/tag/v7.2.0","hostname":"github.com","tags":["WEB","Release Notes"]},{"url":"https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-g8x5-p9qc-cf95","label":"github.com/fastify/fastify-oauth2/security/advisories/GHSA-g8x5-p9qc-cf95","hostname":"github.com","tags":["WEB"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-35935","label":"nvd.nist.gov/vuln/detail/CVE-2023-35935","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/fastify/fastify-oauth2/commit/bff756b456cbb769080631af2beb85671ff4c79c","label":"github.com/fastify/fastify-oauth2/commit/bff756b456cbb769080631af2beb85671ff4c79c","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/fastify/fastify-oauth2","label":"github.com/fastify/fastify-oauth2","hostname":"github.com","tags":["PACKAGE"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":["CVE-2023-35935"],"related":[]},"timeline":[{"kind":"published","date":"2023-07-04T16:29:20.281Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-11-26T18:47:25.202Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":45,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T21:52:06.015Z","stale":false,"partial":false}}