OAuth 2.0 Plugin Vulnerability in Fastify by @fastify
CVE-2026-18165
4.2MEDIUM
What is CVE-2026-18165?
The @fastify/oauth2 plugin for Fastify exhibits a vulnerability in versions prior to 8.3.0, where it improperly validates the OAuth state and PKCE code verifier. This flaw allows an attacker with the ability to set a cookie for the affected host to spoof the OAuth flow, leading to unauthorized authentication of users without compromising their credentials or tokens. The vulnerability can be mitigated by upgrading to version 8.3.0 and enabling the hostPrefixedCookies option or implementing server-side session binding.
Affected Version(s)
@fastify/oauth2 7.2.0 < 8.3.0
@fastify/oauth2 8.3.0
