CVE-2026-18165

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

MEDIUM
5.4
CVSS Score
Published: August 15, 2026 at 01:45 PM UTC
Updated: September 4, 2026 at 03:36 PM UTC
2 products affected across 2 vendorsFastify /oauth2@fastify/oauth2

Using @fastify/oauth2 by @fastify/oauth2?

Get instant alerts when new vulnerabilities affect @fastify/oauth2 - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.4
Exploit prediction
EPSS 0.1%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

7.2.0 ≤ v < 8.3.0
Affected range stops below 8.3.0, so it looks safe — our inference, not a vendor statement
7.2.0 ≤ v < 8.3.07.2.0
Vendor states this is fixed in 8.3.0 (unaffected)

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (2)

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-352

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card