# CVE-2025-68481: FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.9
- **CVSS:** 5.9 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.39% (percentile 24, 2026-11-26)
- **CWE:** CWE-285, CWE-352
- **Aliases:** GHSA-5j53-63w8-8625, PYSEC-2026-1363
- **Published:** 2025-12-19T20:14:07.636Z
- **Modified:** 2026-10-13T11:10:00.203Z

## Who should check

- Projects that depend on PyPI package fastapi-users (\< 15.0.2)
- Anyone running fastapi-users \< 15.0.2

## Description

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 and fixed versions

- PyPI `fastapi-users`: affected \< 15.0.2; fixed 15.0.2 (osv)
- fastapi-users: \< 15.0.2 (cvelist)

## Mitigation

- Upgrade fastapi-users to 15.0.2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-68481. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-68481.md
Affected: fastapi-users < 15.0.2
Fixed in: 15.0.2

Steps:
1. Search this machine and project for fastapi-users (PyPI), fastapi-users: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-68481 being exploited?

There is no confirmed exploitation: CVE-2025-68481 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.39% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-68481?

Medium: CVSS 5.9 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2025-68481?

fastapi-users \< 15.0.2.

### Is there a fix for CVE-2025-68481?

Yes. Fixed in 15.0.2. Upgrade fastapi-users to 15.0.2 or later.

### How do I check if I'm affected by CVE-2025-68481?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/fastapi-users/fastapi-users/security/advisories/GHSA-5j53-63w8-8625>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-68481>
- vendor: <https://github.com/advisories/GHSA-5j53-63w8-8625>
- patch: <https://github.com/fastapi-users/fastapi-users/commit/7cf413cd766b9cb0ab323ce424ddab2c0d235932>
- other: <https://github.com/fastapi-users/fastapi-users/blob/bcee8c9b884de31decb5d799aead3974a0b5b158/fastapi_users/router/oauth.py#L111>
- other: <https://github.com/fastapi-users/fastapi-users/blob/bcee8c9b884de31decb5d799aead3974a0b5b158/fastapi_users/router/oauth.py#L57>
- other: <https://github.com/fastapi-users/fastapi-users>
- other: <https://pypi.org/project/fastapi-users>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-68481>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-5j53-63w8-8625> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-1363> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-68481> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-68481>
