{"id":"CVE-2023-31999","aliases":["GHSA-g8x5-p9qc-cf95"],"summary":"All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all requests for all users.","published_at":"2023-07-04T00:00:00Z","modified_at":"2024-11-26T18:47:25.202Z","products":[],"rating":{"severity":"high","score":7.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","attack_path":"internet_unauthenticated","user_interaction":true,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.0070500001311302185,"percentile":0.5409799814224243,"date":"2026-11-19T00:00:00Z"},"priority":8.9,"details":"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.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"npm/@fastify/oauth2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"v7.2.0"},{"fixed":"v7.2.0"}]}],"fixed":["v7.2.0"],"provider":"cvelistv5","source":"CVE-2023-31999","relation":"self"},{"ecosystem":"NVD","package":"fastify:oauth2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.2.0"}]}],"fixed":["7.2.0"],"provider":"nvd","source":"CVE-2023-31999","relation":"self"},{"ecosystem":"npm","package":"@fastify/oauth2","purl":"pkg:npm/%40fastify/oauth2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"7.2.0"}]}],"fixed":["7.2.0"],"provider":"osv","source":"GHSA-g8x5-p9qc-cf95","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","cpe":"cpe:/a:redhat:openshift_devspaces:3","status":"affected","packages":["devspaces/dashboard-rhel8"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2023-31999"}],"records":[{"provider":"cvelistv5","source_id":"CVE-2023-31999","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2023-31999","license":"CC-BY-4.0","published_at":"2023-07-04T16:29:20.281Z","modified_at":"2024-11-26T18:47:25.202Z","summary":"All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all requests for all users.","details":"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.","severity":[],"affected":[{"ecosystem":"CVE","package":"npm/@fastify/oauth2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"v7.2.0"},{"fixed":"v7.2.0"}]}],"fixed":["v7.2.0"],"provider":"cvelistv5","source":"CVE-2023-31999","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://hackerone.com/reports/2020418"},{"type":"WEB","url":"https://auth0.com/docs/secure/attack-protection/state-parameters"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0"}]},{"provider":"nvd","source_id":"CVE-2023-31999","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-31999","severity":[],"affected":[{"ecosystem":"NVD","package":"fastify:oauth2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.2.0"}]}],"fixed":["7.2.0"],"provider":"nvd","source":"CVE-2023-31999","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"GHSA-g8x5-p9qc-cf95","relation":"self","url":"https://osv.dev/vulnerability/GHSA-g8x5-p9qc-cf95","license":"CC-BY-4.0","published_at":"2023-07-05T21:36:56Z","modified_at":"2023-11-08T04:12:32.265455Z","summary":"@fastify/oauth2 vulnerable to Cross Site Request Forgery due to reused Oauth2 state","details":"### Impact\n\nAll versions of @fastify/oauth2 used a statically generated `state` parameter at startup time and were used across all requests for all users.\nThe 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\n### Patches\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.\n\nNote that this contains a breaking change in the `checkStateFunction` function, which now accepts the full `Request` object.\n\n### Workarounds\n\nThere are no known workarounds.\n\n### References\n\n* [Prevent Attacks and Redirect Users with OAuth 2.0 State Parameters](https://auth0.com/docs/secure/attack-protection/state-parameters)","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","source":"GHSA-g8x5-p9qc-cf95"}],"affected":[{"ecosystem":"npm","package":"@fastify/oauth2","purl":"pkg:npm/%40fastify/oauth2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"7.2.0"}]}],"fixed":["7.2.0"],"provider":"osv","source":"GHSA-g8x5-p9qc-cf95","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-g8x5-p9qc-cf95"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-35935"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/commit/bff756b456cbb769080631af2beb85671ff4c79c"},{"type":"WEB","url":"https://auth0.com/docs/secure/attack-protection/state-parameters"},{"type":"PACKAGE","url":"https://github.com/fastify/fastify-oauth2"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0"}]},{"provider":"redhat-vex","source_id":"CVE-2023-31999","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2023-31999","license":"CC-BY-4.0","published_at":"2023-07-04T00:00:00Z","modified_at":"2023-07-26T19:33:58Z","summary":"fastify-oauth2: CSRF due to reused Oauth2 state","details":"A Cross-Site Request Forgery (CSRF) flaw was found in Oauth2. This issue exists due to the state parameter being statically generated at startup time and used across all requests for all users. An attacker could use the value of the state parameter to create forged requests on behalf of other users or other sessions of the same user.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","source":"CVE-2023-31999"},{"type":"Red Hat","score":"Moderate","source":"CVE-2023-31999"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","cpe":"cpe:/a:redhat:openshift_devspaces:3","status":"affected","packages":["devspaces/dashboard-rhel8"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2023-31999"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2023/cve-2023-31999.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2023-31999"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2219737"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2023-31999"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-31999"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-g8x5-p9qc-cf95"}]}],"references":[{"type":"WEB","url":"https://hackerone.com/reports/2020418"},{"type":"WEB","url":"https://auth0.com/docs/secure/attack-protection/state-parameters"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/releases/tag/v7.2.0"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-g8x5-p9qc-cf95"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-35935"},{"type":"WEB","url":"https://github.com/fastify/fastify-oauth2/commit/bff756b456cbb769080631af2beb85671ff4c79c"},{"type":"PACKAGE","url":"https://github.com/fastify/fastify-oauth2"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2023/cve-2023-31999.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2023-31999"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2219737"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2023-31999"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-31999"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2023-31999","url":"https://www.cve.org/CVERecord?id=CVE-2023-31999","license":"CC-BY-4.0","modified_at":"2024-11-26T18:47:25.202Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2023-31999","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-31999","relation":"self"},{"provider":"osv","source_id":"GHSA-g8x5-p9qc-cf95","url":"https://osv.dev/vulnerability/GHSA-g8x5-p9qc-cf95","license":"CC-BY-4.0","modified_at":"2023-11-08T04:12:32.265455Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2023-31999","url":"https://access.redhat.com/security/cve/CVE-2023-31999","license":"CC-BY-4.0","modified_at":"2023-07-26T19:33:58Z","relation":"self"}]}
