{"schemaVersion":3,"id":"CVE-2026-18165","aliases":[],"status":"published","duplicateOf":null,"title":null,"description":"@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.","dates":{"published":"2026-08-15T13:45:51.666Z","modified":"2026-08-17T19:41:55.649Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":5.4,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":4.2,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":5.4,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.001,"percentile":0.00804,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.001},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.001,"percentile":0.00804}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.001,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.001,"percentile":0.00804}]},"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":[],"exploitCount":0,"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":"fastify\\/oauth2","name":"fastify\\/oauth2","label":"fastify\\/oauth2","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 7.2.0, < 8.3.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 7.2.0, < 8.3.0","eol":null,"hubHref":"/vendor/fastify/fastifyoauth2"},{"vendor":"@fastify/oauth2","product":"@fastify/oauth2","name":"@fastify/oauth2","label":"@fastify/oauth2","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 7.2.0, < 8.3.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 7.2.0, < 8.3.0","eol":null,"hubHref":"/vendor/fastifyoauth2/fastifyoauth2"}],"affectedCount":2,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-p8h8-rj28-m8q9","label":"github.com/fastify/fastify-oauth2/security/advisories/GHSA-p8h8-rj28-m8q9","hostname":"github.com","tags":["Mitigation","Vendor Advisory"]},{"url":"https://cna.openjsf.org/security-advisories.html","label":"cna.openjsf.org/security-advisories.html","hostname":"cna.openjsf.org","tags":["Vendor Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2026-08-15T13:45:51.666Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-08-17T19:41:55.649Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":22,"level":"low","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T23:47:57.715Z","stale":false,"partial":false}}