CVE-2025-68481
FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO
Also known as GHSA-5j53-63w8-8625, PYSEC-2026-1363
Mitigation
- Upgrade fastapi-users to 15.0.2 or later.
Who should check
- Projects that depend on PyPI package fastapi-users (< 15.0.2)
- Anyone running fastapi-users < 15.0.2
Vulnerability facts
- Affected
- fastapi-users < 15.0.2
- Fixed in
- 15.0.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 5.9 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:NOpen in CVSS calculator
Show all 8 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
- EPSS
- 0.39% chance of exploitation in 30 days (percentile 24, 2026-11-26)
- CWE
- CWE-285, CWE-352
- Modified
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
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI fastapi-users | < 15.0.2 | 15.0.2 | osv |
| fastapi-users | < 15.0.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
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.
References
Vendor advisories
Patches
Other
- https://github.com/fastapi-users/fastapi-users/blob/bcee8c9b884de31decb5d799aead3974a0b5b158/fastapi_users/router/oauth.py#L111
- https://github.com/fastapi-users/fastapi-users/blob/bcee8c9b884de31decb5d799aead3974a0b5b158/fastapi_users/router/oauth.py#L57
- https://github.com/fastapi-users/fastapi-users
- https://pypi.org/project/fastapi-users
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.