CVE-2026-62322
OAuth state not validated in LINE backend, enabling forced login/linking attacks.
- CVSS 6.5
- CWE-352
- Authentication, Authorization, and Session Management
- Remote
Python Social Auth is a social authentication/registration mechanism. Prior to 5.0.2, the LINE backend exchanges an authorization code without validating the returned OAuth state. An attacker can begin authorization for an attacker-controlled LINE account and induce a victim to visit the resulting callback URL, causing the application to log the victim into the attacker's account. When account linking is enabled, the same missing validation can link the attacker's LINE identity to the victim's existing account and create a persistent unauthorized login path. Only applications with the LINE backend enabled are affected. This issue is fixed in version 5.0.2.
- CWE
- CWE-352
- CVSS base score
- 6.5
- Published
- 2026-10-15
- 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
- Fixed by upgrading
- Yes
Solution
Upgrade python‑social‑auth to version 5.0.2 or newer.
Vulnerable code sample
from urllib.parse import parse_qs
from social_core.backends.line import LineOAuth2
from django.http import HttpResponseRedirect
def line_callback(request):
# VULNERABLE: missing OAuth state validation
code = request.GET.get('code')
# state = request.GET.get('state') # ignored
backend = LineOAuth2()
token = backend.auth_complete(request, response_type='code', code=code)
return HttpResponseRedirect('/login/success/')Patched code sample
from urllib.parse import parse_qs
from social_core.backends.line import LineOAuth2
from django.http import HttpResponseRedirect, HttpResponseBadRequest
def line_callback(request):
# FIX: validate OAuth state to prevent CSRF
code = request.GET.get('code')
state = request.GET.get('state')
if not state or state != request.session.get('social_auth_state'):
return HttpResponseBadRequest('Invalid OAuth state')
backend = LineOAuth2()
token = backend.auth_complete(request, response_type='code', code=code, state=state)
return HttpResponseRedirect('/login/success/')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(line): validate oauth state on callback (python-social-auth/social-core)
social_core/backends/line.py · LineOAuth2.auth_complete
Cite this entry
@misc{vaitp:cve202662322,
title = {{OAuth state not validated in LINE backend, enabling forced login/linking attacks.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-62322},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-62322/}}
}
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 ::
