CVE-2026-57175
SAML backend accepts responses without AuthnRequest check, enabling takeover.
- CVSS 6.4
- CWE-287
- Authentication, Authorization, and Session Management
- Remote
Python Social Auth is a social authentication/registration mechanism. Prior to version 5.0.0, the SAML backend accepted SAML responses on the Assertion Consumer Service endpoint without verifying that they matched a previously issued `AuthnRequest`. Applications using SAML account association could allow an attacker with a valid account on a trusted IdP to link the attacker's SAML identity to a logged-in victim's local account. The attacker could then authenticate through SAML and gain access to the victim's account. The issue affects applications using the SAML backend together with authenticated account association. The issue has been fixed in version 5.0.0 by validating SAML responses against stored `AuthnRequest` IDs.
- CWE
- CWE-287
- CVSS base score
- 6.4
- Published
- 2026-09-24
- OWASP
- A07 Identification and Authentication Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Insecure Authentication Mechanisms
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- python-social-auth
- Fixed by upgrading
- Yes
Solution
Upgrade Python Social Auth to version 5.0.0 or later.
Vulnerable code sample
from social_core.backends.saml import SAMLAuth
from django.http import HttpResponseBadRequest
class MySAMLBackend(SAMLAuth):
def assertion_consumer_service(self, request):
# VULNERABLE: does not verify AuthnRequest ID
saml_response = self.validate_saml_response(request)
# process the response and log the user in
user = self.authenticate(request, saml_response=saml_response)
if user:
return self.login_user(request, user)
return HttpResponseBadRequest("Invalid SAML response")Patched code sample
from social_core.backends.saml import SAMLAuth
from django.http import HttpResponseBadRequest
class MySAMLBackend(SAMLAuth):
def assertion_consumer_service(self, request):
# FIX: verify AuthnRequest ID matches stored request
saml_response = self.validate_saml_response(request)
request_id = request.session.get('saml_authn_request_id')
if not request_id or saml_response.in_response_to != request_id:
return HttpResponseBadRequest("Mismatched AuthnRequest ID")
# process the response and log the user in
user = self.authenticate(request, saml_response=saml_response)
if user:
return self.login_user(request, user)
return HttpResponseBadRequest("Invalid SAML response")Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix(saml): validate responses against AuthnRequest (python-social-auth/social-core)
social_core/backends/saml.py,social_core/backends/saml.py · SAMLAuth.auth_complete,social_core/backends/saml.py · SAMLAuth.auth_url
Cite this entry
@misc{vaitp:cve202657175,
title = {{SAML backend accepts responses without AuthnRequest check, enabling takeover.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-57175},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-57175/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
