Medium, CVSS 5.9PyPIAmendedPublished
FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO
CVE-2025-68481 · GHSA-5j53-63w8-8625
- Affected
- PyPI fastapi-users < 15.0.2
- Fixed in
- 15.0.2· Vendor fix available
- Issue
- 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. generatestatetoken() is always called with an empty statedata dict, so the resulting JWT only contains the fixed audience claim plus an expiration timestamp. \[1\] fastapi\users/router/oauth.py:65-71 On callback, the library merely checks that the JWT verifies under statesecret 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. \[2\] fastapi\users/router/oauth.py:130-141 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=<attackercode&state=<attackerstate. Because the state JWT is valid for any client for \~1 hour, the victim’s browser will complete the flow. This…
Recommended action: Upgrade to 15.0.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.