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

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.27%, higher than 21% of CVEs (2026-12-02)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-12-19T20:14:07.636Z
- Modified: 2026-10-13T11:10:00.203Z
- Also known as: GHSA-5j53-63w8-8625, PYSEC-2026-1363
- Weaknesses: CWE-285, CWE-352
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- fastapi-users fastapi-users: < 15.0.2
- fastapi-users (PyPI): before 15.0.2
- fastapi-users_project fastapi_users: before 15.0.2

## Every score

- GitHub_M: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N`
- GitHub: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N`

## References

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

## Sources

- CVE List: [CVE-2025-68481](https://www.cve.org/CVERecord?id=CVE-2025-68481), CVE Terms of Use, modified 2025-12-19
- GitHub Advisory Database: [GHSA-5j53-63w8-8625](https://github.com/advisories/GHSA-5j53-63w8-8625), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2025-68481](https://nvd.nist.gov/vuln/detail/CVE-2025-68481), Public domain, modified 2026-10-13
- PyPA Advisory Database: [PYSEC-2026-1363](https://osv.dev/vulnerability/PYSEC-2026-1363), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-68481 · Whole record: https://cve.day/CVE-2025-68481.json · Rebuilt by cve.day 2026-11-25T22:59:09.757Z
