VAITP Dataset

← Back to the dataset

CVE-2026-115910

OpenID Connect nonce not bound to session, allowing auth code replay.

  • CVSS 6.8
  • CWE-345
  • Authentication, Authorization, and Session Management
  • Remote

Python Social Auth is a social authentication and registration mechanism. Prior to 6.2.0, OpenIdConnectAuth in social_core/backends/open_id_connect.py uses get_and_store_nonce to place the OpenID Connect nonce in a shared OpenIdConnectAssociation table, and get_nonce and validate_claims verify only that the nonce exists and has not expired rather than binding it to the browser session and OAuth state that initiated the login. An attacker who obtains a victim's unused authorization code can start a separate login to obtain valid state for the attacker's browser, submit the victim's code with that state, and pass nonce validation because the victim nonce is globally available. With DEFAULT_USE_PKCE disabled in the default OpenIdConnectAuth configuration, the attacker can be logged in as the victim. This issue is fixed in version 6.2.0.

CVSS base score
6.8
Published
2026-10-26
OWASP
A07 Identification and Authentication Failures
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Authentication, Authorization, and Session Management
Subcategory
Session Management Issues
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Python Social Auth
Fixed by upgrading
Yes

Solution

Upgrade python‑social‑auth to version 6.2.0 or later.

Vulnerable code sample

from social_core.backends.open_id_connect import OpenIdConnectAuth
from social_core.utils import get_strategy

# Simulated shared nonce store (global)
NONCE_STORE = {}

class MyOpenIdConnectAuth(OpenIdConnectAuth):
    def get_and_store_nonce(self, strategy):
        nonce = strategy.generate_nonce()
        # store nonce globally, not bound to session/state
        NONCE_STORE[nonce] = True  # VULNERABLE: nonce not bound to session/state
        return nonce

    def validate_nonce(self, strategy, nonce):
        # Only checks existence and expiry
        return NONCE_STORE.get(nonce, False)

    def auth_complete(self, *args, **kwargs):
        strategy = get_strategy()
        # Assume 'code' and 'state' come from request
        code = strategy.request_data().get('code')
        state = strategy.request_data().get('state')
        nonce = strategy.session_get('oidc_nonce')
        if not self.validate_nonce(strategy, nonce):
            raise Exception('Invalid nonce')
        # Continue login flow...
        return super().auth_complete(*args, **kwargs)

Patched code sample

from social_core.backends.open_id_connect import OpenIdConnectAuth
from social_core.utils import get_strategy

# Simulated nonce store bound to session state
NONCE_STORE = {}

class MyOpenIdConnectAuth(OpenIdConnectAuth):
    def get_and_store_nonce(self, strategy):
        nonce = strategy.generate_nonce()
        # bind nonce to the current OAuth state
        state = strategy.session_get('oauth_state')
        NONCE_STORE[(nonce, state)] = True  # FIX: bind nonce to session state
        return nonce

    def validate_nonce(self, strategy, nonce):
        state = strategy.session_get('oauth_state')
        # verify nonce is tied to the same state
        return NONCE_STORE.get((nonce, state), False)

    def auth_complete(self, *args, **kwargs):
        strategy = get_strategy()
        code = strategy.request_data().get('code')
        state = strategy.request_data().get('state')
        # store current state for validation
        strategy.session_set('oauth_state', state)
        nonce = strategy.session_get('oidc_nonce')
        if not self.validate_nonce(strategy, nonce):
            raise Exception('Invalid nonce')
        return super().auth_complete(*args, **kwargs)

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(oidc): bind nonce to initiating session (python-social-auth/social-core)
    social_core/backends/open_id_connect.py, social_core/backends/open_id_connect.py · OpenIdConnectAuth.auth_params, social_core/backends/open_id_connect.py · OpenIdConnectAuth.validate_claims, social_core/backends/open_id_connect.py · OpenIdConnectAuth.__init__

Cite this entry

@misc{vaitp:cve2026115910,
  title        = {{OpenID Connect nonce not bound to session, allowing auth code replay.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-115910},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115910/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.