Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2026-18165— @fastify/oauth2 vulnerable to Login CSRF via plantable OAuth state cookies

Quick assessment

Affected
@fastify/oauth2 @fastify/oauth2
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Fastify @fastify/oauth2是Fastify组织的一款支持OAuth2认证的插件。 Fastify @fastify/oauth2 7.2.0版本至8.3.0之前版本存在跨站请求伪造漏洞,该漏洞源于对OAuth状态和PKCE验证器的验证不当,通过比较回调查询参数与未加前缀的可预测cookie且无服务器端绑定,可能导致跨站请求伪造攻击,使受害者登录攻击者账户。

CVSS 4.2 · Medium EPSS 0.10% · P1

Possible ATT&CK Techniques 1 AI

T1566.001 · Spearphishing Attachment

Affected Version Matrix 2

VendorProduct Version RangeStatus
@fastify/oauth2 @fastify/oauth2 7.2.0< 8.3.0 affected
8.3.0 unaffected
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-18165

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
@fastify/oauth2 vulnerable to Login CSRF via plantable OAuth state cookies
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Source: CVE Program / CVE List V5
Vulnerability Type
跨站请求伪造(CSRF)
Source: CVE Program / CVE List V5
Vulnerability Title
Fastify @fastify/oauth2 跨站请求伪造漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Fastify @fastify/oauth2是Fastify组织的一款支持OAuth2认证的插件。 Fastify @fastify/oauth2 7.2.0版本至8.3.0之前版本存在跨站请求伪造漏洞,该漏洞源于对OAuth状态和PKCE验证器的验证不当,通过比较回调查询参数与未加前缀的可预测cookie且无服务器端绑定,可能导致跨站请求伪造攻击,使受害者登录攻击者账户。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
@fastify/oauth2 @fastify/oauth2 7.2.0 ~ 8.3.0 -

II. Public POCs for CVE-2026-18165

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-18165

请登录查看更多情报信息。

Vendor Advisories for CVE-2026-18165 (1)

IV. Related Vulnerabilities

V. Comments for CVE-2026-18165

No comments yet


Leave a comment