CVE-2026-28415
JSON

4.3medium

Gradio has Open Redirect in OAuth Flow

Severity
4.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.28% (higher than 22% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-pfjf-5gxr-995xPYSEC-2026-65

Description

Gradio is an open-source Python package designed for quick prototyping. Prior to version 6.6.0, 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). Starting in version 6.6.0, the _target_url parameter is sanitized to only use the path, query, and fragment, stripping any scheme or host.

Affected

Product or packageVersionsReported by
gradio-app gradio< 6.6.0CVE List
gradio (PyPI)before 6.6.0GitHub Advisory Database, PyPA Advisory Database
gradio_project gradiobefore 6.6.0NVD

All scores

GitHub_M4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
GitHub4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
NVD4.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N
PyPA Advisory Database4.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:L/A:N

Classification

CWE-200CWE-284CWE-330CWE-601

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Gradio is an open-source Python package designed for quick prototyping. Prior to version 6.6.0, 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). Starting in version 6.6.0, the _target_url parameter is sanitized to only use the path, query, and fragment, stripping any scheme or host.

GitHub Advisory Database

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


  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.

NVD (es)

Gradio es un paquete Python de código abierto diseñado para la creación rápida de prototipos. Antes de la versión 6.6.0, la función _redirect_to_target() en el flujo OAuth de Gradio acepta un parámetro de consulta _target_url no validado, lo que permite la redirección a URL externas arbitrarias. Esto afecta a los endpoints /logout y /login/callback en aplicaciones Gradio con OAuth habilitado (es decir, aplicaciones que se ejecutan en Hugging Face Spaces con gr.LoginButton). A partir de la versión 6.6.0, el parámetro _target_url se sanea para usar solo la ruta, la consulta y el fragmento, eliminando cualquier esquema o host.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-28415 changed 2026-03-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-pfjf-5gxr-995x changed 2026-06-06CC-BY-4.0
NVDCVE-2026-28415 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-65 changed 2026-05-20CC-BY-4.0