๐Ÿ” CVE Alert

CVE-2026-18165

MEDIUM 4.2

@fastify/oauth2 vulnerable to Login CSRF via plantable OAuth state cookies

CVSS Score
4.2
EPSS Score
0.0%
EPSS Percentile
0th

@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.

CWE CWE-352
Vendor @fastify/oauth2
Product @fastify/oauth2
Published Aug 15, 2026
Stay Ahead of the Next One

Get instant alerts for @fastify/oauth2 @fastify/oauth2

Be the first to know when new medium vulnerabilities affecting @fastify/oauth2 @fastify/oauth2 are published โ€” delivered to Slack, Telegram or Discord.

Get Free Alerts โ†’ Free ยท No credit card ยท 60 sec setup

CVSS v3 Breakdown

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality
Integrity
Availability

Affected Versions

@fastify/oauth2 / @fastify/oauth2
7.2.0 < 8.3.0

References

NVD โ†— CVE.org โ†— EPSS Data โ†—
github.com: https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-p8h8-rj28-m8q9 cna.openjsf.org: https://cna.openjsf.org/security-advisories.html

Credits

๐Ÿ” kleju13 mcollina UlisesGascon