Cross-site Request Forgery (CSRF) Affecting fastapi-sso package, versions [,0.19.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.12% (32nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-FASTAPISSO-14386403
  • published18 Dec 2025
  • disclosed9 Dec 2025
  • creditDavid Borș (Snyk Security Research)

Introduced: 9 Dec 2025

CVE-2025-14546  (opens in a new tab)
CWE-285  (opens in a new tab)
CWE-352  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade fastapi-sso to version 0.19.0 or higher.

Overview

fastapi-sso is a FastAPI plugin to enable SSO to most common providers (such as Facebook login, Google login and login via Microsoft Office 365 Account)

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) due to the improper validation of the OAuth state parameter during the authentication callback. While the get_login_url method allows for state generation, it does not persist the state or bind it to the user's session. Consequently, the verify_and_process method accepts the state received in the query parameters without verifying it against a trusted local value. This allows a remote attacker to trick a victim into visiting a malicious callback URL, which can result in the attacker's account being linked to the victim's internal account.

PoC

  1. Create a FastAPI SSO App with an internal logic that, when an already logged-in user performs a callback request, links the newly provided SSO identity to the already existing user that made the request;
  2. Start an SSO OAuth flow, but stop it right before making the callback call to FastAPI SSO App;
  3. The attacker tricks a logged-in user (via phishing, a drive-by attack, etc.) to perform a GET request with the attacker's state value and grant code to the FastAPI SSO App callback. Because the library doesn’t perform any check of the state token, the callback is processed, the grant code is sent to the provider, and the account linking takes place.

CVSS Base Scores

version 4.0
version 3.1