{"answers":{"affected":"3 open source packages ship an affected version, including fastapi-users. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-68481 exists.","fix":"Upgrade fastapi-users to 15.0.2 or later.","what":"CVE-2025-68481 is a medium-severity vulnerability in fastapi-users, published on 19 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2025-68481 and fix it if it is affected.\n\nWhat it is: CVE-2025-68481 is a medium-severity vulnerability in fastapi-users, published on 19 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-68481 exists.\n\nAffected packages and fixed versions:\n- fastapi-users (PyPI): affected all versions; fixed in 15.0.2\n- fastapi-users (PyPI): affected all versions; fixed in 15.0.2\n- fastapi-users (PyPI): affected all versions; fixed in 15.0.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-68481/ (Markdown: https://insights.sbomify.com/CVE-2025-68481/index.md)","id":"CVE-2025-68481","markdown":"https://insights.sbomify.com/CVE-2025-68481/index.md","name":"CVE-2025-68481","record":{"aliases":["GHSA-5j53-63w8-8625","PYSEC-2026-1363"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["account_takeover","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"FastAPI authentication library","requires_auth":"none","summary":"Attackers can perform login CSRF to take over victim accounts or force them into attacker sessions due to stateless OAuth state tokens.","user_interaction":"required","vuln_class":"csrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"fastapi_users","vendor":"fastapi-users_project"}],"cvss":{"score":5.9,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"},{"id":"CWE-285","name":"Improper Authorization"}],"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=\u003cattacker_code\u003e\u0026state=\u003cattacker_state\u003e`. 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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"FastAPI Users Vulnerable to 1-click Account Takeover in Apps Using FastAPI SSO","id":"CVE-2025-68481","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"csrf","year":"2025"},"n_packages":3,"n_references":4,"next":{"headline":"Weak cryptography in FortiAnalyzer","id":"CVE-2025-68482"},"packages":[{"ecosystem":"PyPI","fixed":["15.0.2"],"introduced":["0"],"last_affected":[],"package":"fastapi-users","purl":null,"source":"GHSA-5j53-63w8-8625"},{"ecosystem":"PyPI","fixed":["15.0.2"],"introduced":["0"],"last_affected":[],"package":"fastapi-users","purl":"pkg:pypi/fastapi-users","source":"GHSA-5j53-63w8-8625"},{"ecosystem":"PyPI","fixed":["15.0.2"],"introduced":["0"],"last_affected":[],"package":"fastapi-users","purl":"pkg:pypi/fastapi-users","source":"PYSEC-2026-1363"}],"prev":{"headline":"Marshmallow has DoS in Schema.load(many)","id":"CVE-2025-68480"},"products":["fastapi-users"],"published":"2025-12-19","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-12-19","vendors":["fastapi-users"]},"summary":"Attackers can perform login CSRF to take over victim accounts or force them into attacker sessions due to stateless OAuth state tokens.","url":"https://insights.sbomify.com/CVE-2025-68481/"}