PT-2026-73032 · Npm · @Fastify/Oauth2
CVSS v3.1
5.4
Medium
| Vector | AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
Name of the Vulnerable Software and Affected Versions
@fastify/oauth2 versions 7.2.0 through 8.2.x
Description
This plugin validates the OAuth state and the PKCE code verifier by comparing the callback query parameter against an unprefixed, predictable cookie that lacks server-side binding to the browser that initiated the flow. An attacker capable of writing a cookie for the application's host, such as through a sibling subdomain, can plant matching state and verifier cookies. This allows the attacker to complete an OAuth flow within a victim's browser, silently signing the victim into the attacker's account, a process known as login CSRF (Cross-Site Request Forgery). This issue does not expose the victim's own account, credentials, or tokens.
Recommendations
Update to version 8.3.0 and enable the
hostPrefixedCookies option.
Bind state to a server-side session.Exploit
Fix
CSRF
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
@Fastify/Oauth2