CVE-2026-28415: Gradio has Open Redirect in OAuth Flow
Summary
The redirecttotarget() function in Gradio's OAuth flow accepts an unvalidated targeturl query parameter, allowing redirection to arbitrary external URLs. This affects the /logout and /login/callback endpoints on Gradio apps with OAuth enabled (i.e. apps running on Hugging Face Spaces with gr.LoginButton).
Details
python
def redirecttotarget(request, defaulttarget="/"): target = request.queryparams.get("targeturl", defaulttarget) return RedirectResponse(target) # No validation An attacker can craft a URL like https://my-space.hf.space/logout?targeturl=https://evil.com/phishing that redirects the user to an external site after logout. Because the URL originates from a trusted hf.space domain, users are more likely to trust the link.
Impact
Phishing — an attacker can use the trusted domain to redirect users to a malicious site. No direct data exposure or server-side impact.
## Fix The targeturl parameter is now sanitized to only use the path, query, and fragment, stripping any scheme or host.
Other sources
Gradio is an open-source Python package designed for quick prototyping. Prior to version 6.6.0, the redirecttotarget() function in Gradio's OAuth flow accepts an unvalidated targeturl query parameter, allowing redirection to arbitrary external URLs. This affects the /logout and /login/callback endpoints on Gradio apps with OAuth enabled (i.e. apps running on Hugging Face Spaces with gr.LoginButton). Starting in version 6.6.0, the targeturl parameter is sanitized to only use the path, query, and fragment, stripping any scheme or host.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/gradioto a version that resolves this vulnerability.Fixed in 6.6.0 - Upgrade
Upgrade
Gradioto a version that resolves this vulnerability.Fixed in 6.6.0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-28415?
CVE-2026-28415 is classified as a high severity vulnerability due to the potential for arbitrary redirection to unsafe external websites.
How do I fix CVE-2026-28415?
To mitigate CVE-2026-28415, update Gradio to version 6.6.0 or later, which includes a fix for the unvalidated redirect issue.
What are the risks associated with CVE-2026-28415?
The risks of CVE-2026-28415 include phishing attacks and exposure to malicious sites as a result of the open redirect vulnerability in the OAuth flow.
Which versions of Gradio are affected by CVE-2026-28415?
CVE-2026-28415 affects Gradio versions prior to 6.6.0.
What components of Gradio are impacted by CVE-2026-28415?
The vulnerability specifically impacts the _redirect_to_target() function in Gradio's OAuth flow.