GitHub Advisoryadvisory · PyPI

GHSA-pfjf-5gxr-995x Gradio has an Open Redirect in its OAuth Flow

MEDIUM Published 2026-03-01 Modified 2026-06-06 Official page ↗
Aliases
CVE-2026-28415
Ecosystem
PyPI
Packages
gradio
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
Weaknesses
CWE-200, CWE-284, CWE-330, CWE-601
Reviewed
2026-03-01

Affected packages

• PyPI gradio: < 6.6.0 → fixed in 6.6.0

Description

Summary The _redirect_to_target() function in Gradio's OAuth flow accepts an unvalidated _target_url 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 _redirect_to_target(request, default_target="/"): target = request.query_params.get("_target_url", default_target) return RedirectResponse(target) # No validation ``` An attacker can craft a URL like https://my-space.hf.space/logout?_target_url=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 _target_url parameter is now sanitized to only use the path, query, and fragment, stripping any scheme or host.

Related

Alias · CVE (1)

  • CVE-2026-28415 Gradio is an open-source Python package designed for quick prototyping. vulnerability

Weakness · CWE (4)

  • CWE-200 Exposure of Sensitive Information to an Unauthorized Actor weakness
  • CWE-284 Improper Access Control weakness
  • CWE-330 Use of Insufficiently Random Values weakness
  • CWE-601 URL Redirection to Untrusted Site weakness

References