CVE-2026-18165: @fastify/oauth2 vulnerable to Login CSRF via plantable OAuth state cookies
Vulnerability summary
CVE-2026-18165 is a medium (CVSS 5.4) Cross-Site Request Forgery vulnerability in fastify fastify\/oauth2. EPSS estimates a 0.11% chance of exploitation in the next 30 days, higher than 1.2% of scored vulnerabilities.
Not severe (CVSS 4.2, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 15-08-2026PublishedVulnerability first disclosed.
- 17-08-2026Last modifiedVulnerability information updated.
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.
CVSS metrics
2 scores · 2 sources · 1 version- CVE.orgCNA4.2MediumCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:NDiffers
EPSS trend
Probability
0.11%
Chance of exploitation in the next 30 days
Percentile
1%
Versus all other CVEs
30-day change
Decrease -0.02 pp
From 0.13% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.
@fastify/oauth21 product
- @fastify/oauth2≥ 7.2.0, < 8.3.0
Fastify1 product
- fastify\/oauth2≥ 7.2.0, < 8.3.0
2 vendors · 2 products
References
2 links- cna.openjsf.org/security-advisories.htmlVendor Advisory