---
id: CVE-2025-68481
title: >-
  FastAPI Users allows users to quickly add a registration and authentication
  system to their FastAPI project
summary: >-
  FastAPI Users allows users to quickly add a registration and authentication
  system to their FastAPI project. Prior to version 15.0.2, the OAuth login
  state tokens are completely stateless and carry no per-request entropy or any
  data that…
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N'
cwe:
  - CWE-285
  - CWE-352
vendor: fastapi-users_project
product: fastapi_users
affected:
  - fastapi_users < 15.0.2
patched:
  - fastapi_users 15.0.2
published: '2025-12-19'
updated: '2026-10-13'
sourceUpdated: '2026-10-13T11:10:00.203'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2025-68481'
references:
  - url: >-
      https://github.com/fastapi-users/fastapi-users/blob/bcee8c9b884de31decb5d799aead3974a0b5b158/fastapi_users/router/oauth.py#L111
    label: security-advisories@github.com
  - url: >-
      https://github.com/fastapi-users/fastapi-users/blob/bcee8c9b884de31decb5d799aead3974a0b5b158/fastapi_users/router/oauth.py#L57
    label: security-advisories@github.com
  - url: >-
      https://github.com/fastapi-users/fastapi-users/commit/7cf413cd766b9cb0ab323ce424ddab2c0d235932
    label: security-advisories@github.com
  - url: >-
      https://github.com/fastapi-users/fastapi-users/security/advisories/GHSA-5j53-63w8-8625
    label: security-advisories@github.com
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2025-68481'
  - url: 'https://github.com/fastapi-users/fastapi-users'
tags:
  - nvd
  - osv
  - pip
epss: 0.00258
epssPercentile: 0.17432
aliases:
  - GHSA-5j53-63w8-8625
  - PYSEC-2026-1363
ecosystem: pip
ingestedAt: '2026-07-08T18:25:46.015Z'
---

## Overview

FastAPI Users allows users to quickly add a registration and authentication system to their FastAPI project. Prior to version 15.0.2, the OAuth login state tokens are completely stateless and carry no per-request entropy or any data that could link them to the session that initiated the OAuth flow. `generate_state_token()` is always called with an empty `state_data` dict, so the resulting JWT only contains the fixed audience claim plus an expiration timestamp. On callback, the library merely checks that the JWT verifies under `state_secret` and is unexpired; there is no attempt to match the state value to the browser that initiated the OAuth request, no correlation cookie, and no server-side cache. Any attacker can hit `/authorize`, capture the server-generated state, finish the upstream OAuth flow with their own provider account, and then trick a victim into loading `.../callback?code=<attacker_code>&state=<attacker_state>`. Because the state JWT is valid for any client for \~1 hour, the victim’s browser will complete the flow. This leads to login CSRF. Depending on the app’s logic, the login CSRF can lead to an account takeover of the victim account or to the victim user getting logged in to the attacker's account. Version 15.0.2 contains a patch for the issue.

## Affected

- `fastapi_users < 15.0.2`

## Remediation

Upgrade past the affected range:

- `fastapi_users 15.0.2`

## Package advisory (CVE-2025-68481)

Affected packages:

- `fastapi-users < 15.0.2`

Patched in:

- `fastapi-users 15.0.2`

Source: https://osv.dev/vulnerability/GHSA-5j53-63w8-8625
