CVE-2026-18165: fastify fastify\/oauth2 Cross-Site Request Forgery (CSRF)
Vulnerability summary
CVE-2026-18165 is a medium (CVSS 5.4) Cross-Site Request Forgery (CSRF) vulnerability in fastify fastify\/oauth2. EPSS estimates a 0.10% chance of exploitation in the next 30 days, higher than 0.8% of scored vulnerabilities.
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.10%
Chance of exploitation in the next 30 days
Percentile
1%
Versus all other CVEs
30-day change
0.00 pp
From 0.10% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
@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