Skip to main content

@fastify/oauth2 EUVDEUVD-2026-59767

| CVE-2026-18165 MEDIUM
Cross-Site Request Forgery (CSRF) (CWE-352)
2026-08-15 ce714d77-add3-4f53-aff5-83d477b104bb
5.4
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Control sibling subdomain
  2. Delivery
    Plant matching state/verifier cookies on shared domain
  3. Exploit
    Lure victim through OAuth authorization flow
  4. Execution
    Callback validates planted cookies without session binding
  5. Impact
    Victim browser session silently bound to attacker's account

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V3 - Web Frontend Security Anti-CSRF tokens, SameSite cookies
MITRE ATT&CK

1 technique across 1 tactic: Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the attacker to control a subdomain sharing the same registrable domain as the target application (e.g., attacker controls evil.example.com to target app.example.com), which is the precondition enabling cross-subdomain cookie injection. The victim must be lured through an OAuth 2.0 authorization code flow handled by the affected plugin - either by following a crafted link or being silently redirected. The vulnerability is present in default plugin configurations in versions 7.2.0-8.2.x; the hostPrefixedCookies fix is opt-in and inactive by default even after upgrade to 8.3.0 unless explicitly configured. Exploitation is strictly limited to login CSRF: the victim's own account credentials, OAuth tokens, and account data are not exposed - only the victim's active session becomes bound to the attacker's identity. Deployments where all subdomains under the registrable domain are fully trusted and organizationally controlled are not realistically exploitable.

Impact

The CVSS 4.2 score with AC:H and UI:R accurately reflects the substantial preconditions required: the attacker must possess control over a sibling subdomain on the same registrable domain as the target application, and the victim must actively participate in an OAuth authorization flow. These constraints meaningfully suppress real-world risk - opportunistic mass exploitation is not feasible, and the attack is inapplicable to deployments where the application does not share a registrable domain with untrusted or attacker-controllable subdomains. The impact is bounded by design: the vulnerability achieves login CSRF (victim is signed into the attacker's account), but does not expose the victim's own credentials, account data, or session tokens. This is a meaningful integrity and trust violation - particularly for applications where account confusion could lead to privacy leakage through the attacker observing what the victim does while logged in - but it is not a direct credential or data exfiltration path. No EPSS data was provided in the intelligence feed; exploitation probability inferred from CVSS metrics and the subdomain-control prerequisite is low. The CVE is not listed in CISA KEV and no public exploit code is referenced. SSVC assessment suggests defer or scheduled remediation priority for most deployments; accelerate only if the application is deployed alongside untrusted sibling subdomains.

Exploit ScenarioDerived

An attacker who controls evil.example.com (while the target OAuth application runs at app.example.com) crafts a page that writes cookie values for state and code_verifier matching an attacker-initiated OAuth flow on the same provider. The victim is lured to visit the attacker's page, cookies are planted, and the victim is then redirected through the OAuth authorization code flow; upon callback, the @fastify/oauth2 plugin validates the planted cookies and completes the flow, binding the victim's browser session to the attacker's provider account. No public proof-of-concept code has been identified; exploitation requires attacker control of a sibling subdomain, which limits this to targeted rather than opportunistic attacks.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 15, 2026

Login CSRF in @fastify/oauth2 versions 7.2.0 through 8.2.x allows an attacker controlling a sibling subdomain to plant predictable OAuth state and PKCE code verifier cookies, silently signing a victim into the attacker's account instead of their own. The root cause is the absence of server-side session binding and cookie prefixing - the plugin validates OAuth state exclusively by comparing callback parameters against unprefixed cookies, which sibling subdomains sharing the same registrable domain can freely overwrite. No active exploitation has been confirmed (not in CISA KEV) and no public proof-of-concept exists; the high attack complexity limits opportunistic risk.

RemediationAI

Upgrade @fastify/oauth2 to version 8.3.0, which introduces the hostPrefixedCookies option; this option must be explicitly enabled in plugin configuration to apply __Host- cookie prefixing, which browsers enforce to prevent sibling subdomains from overwriting cookies. If an immediate upgrade is not feasible, the alternative fix described in the advisory is to bind OAuth state to a server-side session (e.g., express-session or a custom session store) rather than relying solely on cookie comparison - this eliminates the cookie-injection vector entirely but requires additional session infrastructure. As a compensating control where neither option is immediately available, ensure no untrusted parties control any subdomain under the same registrable domain as the application, reducing the attack surface to zero; however, this is a deployment-level constraint rather than a code-level fix and may be difficult to guarantee over time. Advisory reference: https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-p8h8-rj28-m8q9.

Affected VersionsENISA

@fastify/oauth2 7.2.0 <8.3.0

Affected Packages

euvd fastify_oauth2 fix: 8.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected package @fastify/oauth2 implements the OAuth 2.0 authorization code flow as a plugin for the Fastify Node.js web framework. The vulnerability class is CWE-352 (Cross-Site Request Forgery), applied specifically to the OAuth callback validation step. The plugin stores the anti-CSRF state parameter and PKCE code_verifier in HTTP cookies without applying cookie prefixes (__Host- or __Secure-). Browser cookie scoping rules allow any subdomain under the same registrable domain (e.g., evil.example.com) to set cookies readable by the target application (app.example.com). Since the plugin performs no server-side session binding - it simply compares the callback query parameter to whatever cookie is present - an attacker who controls a sibling subdomain can pre-plant matching state and verifier values, neutering both the standard OAuth state CSRF protection and the PKCE extension that was specifically designed to prevent code injection. The affected CPE corresponds to the @fastify/oauth2 npm package in the 7.2.x-8.2.x version range on Node.js.

Know when Fastify gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (ce714d77-add3-4f53-aff5-83d477b104bb) PRIMARY MEDIUM
NVD 5.4 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
vuln.today AI 4.2 MEDIUM

Sibling-subdomain cookie write access required (AC:H); victim must participate in OAuth flow (UI:R); impact limited to session confusion with no victim credential exposure (C:L, I:L, A:N).

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Red Hat 3.1 LOW

Primary rating from Vendor (ce714d77-add3-4f53-aff5-83d477b104bb).

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

2
CVSS changed
Sep 04, 2026 - 13:22 NVD
4.2 (MEDIUM) 5.4 (MEDIUM)
Patch available
Aug 15, 2026 - 15:04 EUVD

DescriptionNVD

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

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
Medium
popular OAuth2 plugin for the widely-used Fastify Node.js framework
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.

CVE-2023-31999 HIGH POC
8.8 Jul 04

All versions of @fastify/oauth2 used a statically generated state parameter at startup time and were used across all req

CVE-2021-22964 HIGH POC
8.8 Oct 14

A redirect vulnerability in the `fastify-static` module version >= 4.2.4 and < 4.4.1 allows remote attackers to redirect

CVE-2025-32442 HIGH POC
7.5 Apr 18

Fastify is a fast and low overhead web framework, for Node.js. Rated high severity (CVSS 7.5), this vulnerability is rem

CVE-2020-8136 HIGH POC
7.5 Mar 20

Prototype pollution vulnerability in fastify-multipart < 1.0.5 allows an attacker to crash fastify applications parsing

CVE-2018-3711 HIGH POC
7.5 Jun 07

Fastify node module before 0.38.0 is vulnerable to a denial-of-service attack by sending a request with "Content-Type: a

CVE-2020-8192 MEDIUM POC
6.5 Jul 30

A denial of service vulnerability exists in Fastify v2.14.1 and v3.0.0-rc.4 that allows a malicious user to trigger reso

CVE-2021-22963 MEDIUM POC
6.1 Oct 14

A redirect vulnerability in the fastify-static module version < 4.2.4 allows remote attackers to redirect users to arbit

CVE-2026-6556 CRITICAL
9.1 Jun 30

Authorization bypass in the @fastify/express middleware-compatibility plugin (versions 4.0.6 and earlier) lets unauthent

CVE-2026-33808 CRITICAL
9.1 Apr 15

Authentication bypass in @fastify/express v4.0.4 and earlier allows remote unauthenticated attackers to access protected

CVE-2026-33807 CRITICAL
9.1 Apr 15

Middleware bypass in Fastify Express plugin (fastify/express) allows complete circumvention of authentication, authoriza

CVE-2022-41919 HIGH
8.8 Nov 22

Fastify is a web framework with minimal overhead and plugin architecture. Rated high severity (CVSS 8.8), this vulnerabi

CVE-2026-2880 HIGH
8.2 Feb 27

Authentication and authorization bypass in @fastify/middie (Node.js middleware library for Fastify) allows remote unauth

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy