CVE-2026-28415: Critical OAuth Flaw in Gradio Threatens AI Apps
A critical OAuth vulnerability in Gradio framework allows attackers to hijack AI application accounts through malicious authorization flows. Organizations using Gradio must patch immediately to prevent widespread account takeovers.
# CVE-2026-28415: Critical OAuthOAuth🛡️An open standard authorization protocol that allows applications to access user resources without exposing passwords, using tokens instead of credentials. Flaw in Gradio Threatens AI Apps
Date: [Current Date]
Severity: Critical (CVSS 9.4)
Author: Anthony Bahn, Cybersecurity Journalist
A critical authentication bypassAuthentication Bypass📖A security vulnerabilityVulnerability🛡️A weakness in software, hardware, or processes that can be exploited by attackers to gain unauthorized access or cause harm. that allows an attacker to circumvent the login verification process and gain unauthorized access to a system without providing valid credentials. vulnerability has been discovered in Gradio, the popular open-source Python library used to build machine learning and AI application interfaces. Tracked as CVE-2026-28415, this security flaw affects the OAuth implementation in Gradio's authentication system, potentially exposing thousands of AI applications to unauthorized access and data breaches.
The vulnerability, disclosed on [date], allows attackers to bypass OAuth authentication mechanisms and gain unauthorized access to protected Gradio applications without valid credentials. Security researchers estimate that over 15,000 publicly accessible Gradio applications may be vulnerable, including applications handling sensitive data, proprietaryProprietary📖Software owned by a company with restricted access to source code. AI models, and internal enterprise tools.
What Happened
CVE-2026-28415 is an authentication bypass vulnerability located in Gradio's OAuth integration module, specifically affecting the `gradio.oauth` component introduced in version 3.40.0. The flaw stems from improper validation of OAuth state parameters during the authentication callback process, allowing attackers to forge authentication tokens and impersonate legitimate users.
The vulnerability was discovered by security researcher Dr. Elena Kovacs of the Applied Cryptography Research Group at ETH Zurich during a routine security audit of popular machine learning frameworks. Dr. Kovacs reported the finding to Hugging Face, the maintainers of Gradio, through their responsible disclosure program on February 14, 2026.
Timeline of Discovery:
Technical Overview of the Flaw:
The vulnerability exists in the OAuth callback handler within the `gradio/oauth.py` module. When Gradio applications implement OAuth authentication through providers like Google, GitHub, or Azure AD, the system is supposed to validate the `state` parameter returned during the OAuth callback to prevent cross-site request forgery (CSRF) attacks and session hijackingSession Hijacking🛡️An attack where an adversary takes over a legitimate user session by stealing or predicting session tokens, gaining unauthorized access to systems or data..
However, the vulnerable code fails to properly cryptographically bind the state parameter to the user's session. Instead, it performs only a simple string comparison against a list of recently issued state tokens without verifying:
1. The temporal validity of the state token 2. The binding between the state token and the originating session 3. Whether the state token has already been consumed
This allows an attacker who can intercept or predict a valid state parameter to replay it in their own authentication flow, effectively hijacking another user's authentication session. In practice, attackers can use various techniques including:
Once an attacker successfully bypasses authentication, they gain the same access privileges as the user they're impersonating, which in many Gradio deployments includes:
Who Is Affected
The vulnerability affects a broad spectrum of organizations and individuals using Gradio for deploying machine learning applications. Based on analysis of public Gradio instances and GitHub repository data, security researchers estimate the exposure includes:
Affected Versions:
Unaffected Versions:
Industries and Sectors at High Risk:
Specific High-Profile Applications:
Several well-known Gradio-based applications have been confirmed vulnerable, including:
Geographic Distribution:
Analysis of vulnerable instances shows significant concentrations in:
Technical Analysis
For IT security professionals and system administrators, understanding the technical mechanics of CVE-2026-28415 is crucial for proper remediation and future prevention.
Vulnerability Mechanism:
The core issue resides in the `_oauth_callback()` function within `gradio/oauth.py`. Here's a technical breakdown:
Vulnerable Code Pattern (Simplified):
```python def _oauth_callback(request): state = request.args.get('state') code = request.args.get('code')
# Vulnerable validation if state in active_states: # Process OAuth callback token = exchange_code_for_token(code) user_info = get_user_info(token) create_session(user_info) return redirect('/app') else: return error_response('Invalid state') ```
The vulnerability manifests in several ways:
1. State Token Reuse Vulnerability:
The `active_states` list is maintained as a simple in-memory collection with no mechanism to remove consumed state tokens immediately. The tokens expire only after a 10-minute timeout window. During this window, an attacker can:
Attack Vector Example:
``` 1. Victim initiates OAuth login: state=abc123xyz789 2. Attacker intercepts callback URL via network sniffing or XSS 3. Victim completes authentication 4. Attacker uses same state token: /oauth/callback?state=abc123xyz789&code=[new_code] 5. System validates state as legitimate and grants attacker access ```
2. Session Binding Failure:
The state parameter is not cryptographically bound to the original session identifier. This means:
3. Insufficient Entropy in State Generation:
In certain configurations, particularly when using the default `secrets.token_urlsafe()` with insufficient length parameters, state tokens exhibited patterns that could be partially predicted:
Attack Prerequisites:
For successful exploitation, an attacker needs:
Proof of Concept:
Security researchers have demonstrated reliable exploitation through multiple vectors:
**Method 1: Network Interception**