---
id: "CVE-2026-110008"
kind: "vulnerability"
aliases: ["CVE-2026-110008"]
title: "@fastify/oauth2: OAuth state cookie reuse enables login CSRF attacks"
severity: "medium"
cvss: 4.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["fastify", "node", "oauth", "package", "self-hosted"]
not_affected_if: ["no-oauth-login-route", "version-8.3.2-or-later"]
published_at: "2026-10-19T14:16:57+00:00"
first_seen_at: "2026-10-23T21:57:18+00:00"
updated_at: "2026-10-25T04:41:42+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-110008", "first_seen_at": "2026-10-23T21:57:18+00:00"}]
---

# @fastify/oauth2: OAuth state cookie reuse enables login CSRF attacks

In @fastify/oauth2 versions 7.2.0 through 8.3.1, the OAuth state and code-verifier cookies are not cleared at the callback when the login route has two or more path segments, so a state value stays reusable. An attacker can use this to sign a victim into the attacker's account (login CSRF).

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `npm ls @fastify/oauth2`
- Look for OAuth login routes with two or more path segments that call the plugin's cookie-based state handling
- Confirm whether the plugin is configured with an explicit cookie path

## Fix

- Upgrade @fastify/oauth2 to `8.3.2` or later
- Until upgraded, set an explicit cookie path so the set and clear operations name the same cookie

## Timeline

- 2026-10-23T21:57:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-110008

## From the sources

@fastify/oauth2 is a Fastify wrapper for OAuth2 login flows. In versions 7.2.0 through 8.3.1, the state and code-verifier cookies are set without a Path attribute at a login route with two or more path segments, while the clearing step at the OAuth callback writes them with a root path, so the original cookies survive the callback and the documented single-use guarantee for the state value does not hold. A state value an attacker learns stays valid for the rest of the browser session, letting the attacker drive their own authorization flow in the victim's browser and sign the victim in to the attacker's account (login CSRF). The issue is fixed in @fastify/oauth2 8.3.2, and users should upgrade to 8.3.2 or later. As a workaround, set an explicit cookie path so the set and the clear name the same cookie.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
