SecurityContext

CVE-2026-18165: fastify/oauth2 - Authentication Bypass

  • Cve: CVE-2026-18165
  • Name: fastify/oauth2 - Authentication Bypass
  • 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.
  • Impact: Attackers can silently sign victims into attacker-owned accounts, causing login CSRF without exposing victim credentials.
  • Remediation: Upgrade to version 8.3.0 and enable hostPrefixedCookies option or bind state to a server-side session.
  • Vulnerability type: broken_authentication
  • Vulnerability impact: broken_authentication
  • Requirements: Attacker must be able to write cookies for the application's host
  • Labels source: projectdiscovery
  • Severity: medium
  • Cvss score: 5.4
  • Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
  • Epss score: 0.00137
  • Epss percentile: 0.03056
  • Assignee: ce714d77-add3-4f53-aff5-83d477b104bb
  • Published at: 2026-08-15T14:17:07Z
  • Age in days: 101
  • Modified at: 2026-09-04T13:16:43Z
  • Patch available: yes
  • References total: 2
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-18165
  • Nvd status: analyzed
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: requirement type

Cwe

IdName
CWE-352Cross-Site Request Forgery

Hackerone

  • Reports: 1
  • Rank: 516

References

UrlSourceTags
https://cna.openjsf.org/security-advisories.htmlnvdVendor Advisory
https://github.com/fastify/fastify-oauth2/security/advisories/GHSA-p8h8-rj28-m8q9nvdMitigation, Vendor Advisory

Products

ProductAffectedPlatform boundSourcesUrl
fastify:fastify/oauth2>= 7.2.0, < 8.3.0nonvd/v1/products/fastify/fastify/oauth2

Projects

RepositoryLink kindsIndexedUrl
fastify/fastify-oauth2security_advisoryyes/v1/repositories/fastify/fastify-oauth2

Index

  • Checked, none or zero: repositories, repositories high signal, packages

Exploitation

  • Remote: yes
  • Hackerone reports: 1
  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, authentication required
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, exposed hosts