Skip to content
Heist/ feed
Back to feed
Medium

FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO

Type: advisorySources: OSV

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=&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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-68481
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 13:37 UTC · Revision 1

Source evidence

FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO

core-osv · Original source

Published 19 Dec 2025, 20:14 UTC

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=&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.

osv:CVE-2025-68481
Complete source record
{
  "id": "8829ee0f57d7c9b07c6d6d36aefc605abc3cfb68cd56704143e81b62ef4d27f1",
  "url": "https://osv.dev/vulnerability/CVE-2025-68481",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO",
    "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 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=&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.",
    "evidence": "osv:CVE-2025-68481",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2025-68481",
      "aliases": [
        "CVE-2025-68481",
        "GHSA-5j53-63w8-8625",
        "PYSEC-2026-1363"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/fastapi-users/fastapi-users",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1df7c1038d852c043a7bf637b86dc1932fc2c3c9"
                },
                {
                  "fixed": "7cf413cd766b9cb0ab323ce424ddab2c0d235932"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:fastapi-users_project:fastapi_users:*:*:*:*:*:python:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "15.0.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "7cf413cd766b9cb0ab323ce424ddab2c0d235932"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v15.0.1",
            "v15.0.0",
            "v14.0.2",
            "v14.0.1",
            "v14.0.0",
            "v13.0.0",
            "v12.1.3",
            "v12.1.2",
            "v12.1.1",
            "v12.1.0",
            "v12.0.0",
            "v11.0.0",
            "v10.4.2",
            "v10.4.1",
            "v10.4.0",
            "v10.3.0",
            "v10.2.1",
            "v10.2.0",
            "v10.1.5",
            "v10.1.4",
            "v10.1.3",
            "v10.1.2",
            "v10.1.1",
            "v10.1.0",
            "v10.0.7",
            "v10.0.6",
            "v10.0.5",
            "v10.0.4",
            "v10.0.3",
            "v10.0.2",
            "v10.0.1",
            "v10.0.0",
            "v9.3.2",
            "v9.3.1",
            "v9.3.0",
            "v9.2.6",
            "v9.2.5",
            "v9.2.4",
            "v9.2.3",
            "v9.2.2",
            "v9.2.1",
            "v9.2.0",
            "v9.1.1",
            "v8.1.4",
            "v9.1.0",
            "v9.0.1",
            "v9.0.0",
            "v8.1.3",
            "v8.1.2",
            "v8.1.1",
            "v8.1.0",
            "v8.0.0",
            "v7.0.0",
            "v6.1.3",
            "v6.1.2",
            "v6.1.1",
            "v6.1.0",
            "v6.0.0",
            "v5.1.4",
            "v5.1.3",
            "v5.1.2",
            "v5.1.1",
            "v5.1.0",
            "v5.0.0",
            "v4.0.0",
            "v3.1.2",
            "v3.1.1",
            "v3.1.0",
            "v3.0.7",
            "v3.0.6",
            "v3.0.5",
            "v3.0.4",
            "v3.0.3",
            "v3.0.2",
            "v3.0.1",
            "v3.0.0",
            "v2.0.1",
            "v2.0.0",
            "v1.1.1",
            "v1.1.0",
            "v1.0.0",
            "v0.8.1",
            "v0.8.0",
            "v0.7.3",
            "v0.7.2",
            "v0.7.1",
            "v0.7.0",
            "v0.6.6",
            "v0.6.5",
            "v0.6.4",
            "v0.6.3",
            "v0.6.2",
            "v0.6.1",
            "v0.6.0",
            "v0.5.1",
            "v0.5.0",
            "v0.4.1",
            "v0.4.0",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.0",
            "v0.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-68481.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:36.034210101Z",
      "provider": "osv",
      "references": [
        "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/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68481.json",
        "https://github.com/fastapi-users/fastapi-users/security/advisories/GHSA-5j53-63w8-8625",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-68481",
        "https://github.com/fastapi-users/fastapi-users/commit/7cf413cd766b9cb0ab323ce424ddab2c0d235932"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-285",
          "CWE-352"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68481.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-68481",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 503202,
  "published_at": "2025-12-19T20:14:07.636+00:00"
}