{"id":"CVE-2026-18165","title":"@fastify/oauth2 is an OAuth 2.0 plugin for Fastify","summary":"@fastify/oauth2 is an OAuth 2.0 plugin for Fastify. In versions from 7.2.0 up to but not including 8.3.0, the plugin validates the OAuth state, and with PKCE the code verifier, by comparing the callback query parameter against an unprefi…","severity":"medium","cvss":4.2,"cvssVector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","cwe":["CWE-352","CWE-472"],"published":"2026-08-15","updated":"2026-08-15","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-18165","references":[{"url":"https://cna.openjsf.org/security-advisories.html","label":"ce714d77-add3-4f53-aff5-83d477b104bb"},{"url":"https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-p8h8-rj28-m8q9","label":"ce714d77-add3-4f53-aff5-83d477b104bb"},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-18165.json"},{"url":"https://access.redhat.com/security/cve/CVE-2026-18165"},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2517569"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-18165"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-18165"}],"tags":["nvd","csaf","vex","red-hat"],"ingestedAt":"2026-08-16T13:39:02.800Z","epss":0.001,"epssPercentile":0.00952,"vendor":"Red Hat","product":"Red Hat OpenShift Dev Spaces","affected":["openshift_dev_spaces"],"scores":{"nvd":4.2,"vendor":3.1},"slug":"CVE-2026-18165","body":"## Overview\n\n@fastify/oauth2 is an OAuth 2.0 plugin for Fastify. In versions from 7.2.0 up to but not including 8.3.0, the plugin validates the OAuth state, and with PKCE the code verifier, by comparing the callback query parameter against an unprefixed, predictable cookie, with no server-side binding to the browser that began the flow. Any party able to write a cookie for the application's host, such as a sibling subdomain under the same registrable domain, can plant matching state and verifier cookies and complete an attacker-owned OAuth flow inside a victim's browser, silently signing the victim in to the attacker's account (login CSRF). It does not expose the victim's own account, credentials, or tokens. The issue is fixed in @fastify/oauth2 8.3.0, which adds an opt-in hostPrefixedCookies option. Users should upgrade to 8.3.0 and enable it, or bind state to a server-side session.\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.\n\n## Vendor advisories\n\n- **Red Hat VEX** · Low · affected: Red Hat OpenShift Dev Spaces · no fix planned: Red Hat OpenShift Dev Spaces · updated 2026-09-23 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-18165.json)","depth":"sunlit","depthScore":23,"depthScoreParts":{"impact":23.1,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}