CVE-2026-57176
Vend OAuth2 UID collision allows cross‑shop account takeover.
- CVSS 6.8
- CWE-289
- Design Defects
- Remote
Python Social Auth is a social authentication/registration mechanism. Prior to version 5.0.0, the Vend OAuth2 backend used only the numeric Vend user_id as the social-auth UID. When multiple Vend shops authenticate through the same application, users from different shops with the same internal Vend user ID could collide in the social-auth association table. A user from one shop could then be authenticated as the local account previously associated with the same numeric user ID from another shop. The issue affects applications using the Vend OAuth2 backend with more than one Vend shop. Version 5.0.0 patches the issue.
- CWE
- CWE-289
- CVSS base score
- 6.8
- Published
- 2026-09-24
- OWASP
- A07 Identification and Authentication Failures
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- Category
- Design Defects
- Subcategory
- Poorly Designed Access Controls
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- Python Social Auth
- Fixed by upgrading
- Yes
Solution
Upgrade to python‑social‑auth 5.0.0 or later.
Vulnerable code sample
from social_core.backends.oauth import BaseOAuth2
class VendOAuth2(BaseOAuth2):
name = "vend"
AUTHORIZATION_URL = "https://login.vendhq.com/oauth/authorize"
ACCESS_TOKEN_URL = "https://login.vendhq.com/oauth/token"
USER_DATA_URL = "https://api.vendhq.com/api/0.1/user"
# VULNERABLE: using only numeric user_id allows collisions across shops
def get_user_id(self, details, response):
return str(response["user_id"])
def user_data(self, access_token, *args, **kwargs):
return self.get_json(self.USER_DATA_URL, params={"access_token": access_token})Patched code sample
from social_core.backends.oauth import BaseOAuth2
class VendOAuth2(BaseOAuth2):
name = "vend"
AUTHORIZATION_URL = "https://login.vendhq.com/oauth/authorize"
ACCESS_TOKEN_URL = "https://login.vendhq.com/oauth/token"
USER_DATA_URL = "https://api.vendhq.com/api/0.1/user"
# FIX: include shop identifier to make UID globally unique
def get_user_id(self, details, response):
shop_id = response.get("shop_id", "unknown")
return f"{shop_id}-{response['user_id']}"
def user_data(self, access_token, *args, **kwargs):
return self.get_json(self.USER_DATA_URL, params={"access_token": access_token})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(vend): scope OAuth UID by shop (python-social-auth/social-core)
social_core/backends/vend.py,social_core/backends/vend.py · VendOAuth2.access_token_url,social_core/backends/vend.py · VendOAuth2.user_data,social_core/storage.py · UserMixin.create_social_auth,social_core/storage.py · UserMixin.get_social_auth
Cite this entry
@misc{vaitp:cve202657176,
title = {{Vend OAuth2 UID collision allows cross‑shop account takeover.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-57176},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-57176/}}
}
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 ::
