CVE-2026-28415: Gradio Gradio Has An Open Redirect Vulnerability

MODERATE
Advisory Identifier: GHSA-pfjf-5gxr-995x
CVSS 4.3
CWE-284 CWE-601 CWE-330 CWE-200
Published
Advisory Summary

CVE-2026-28415 is a MODERATE (CVSS 4.3) gradio has an open redirect vulnerability (CWE-284: Improper Access Control) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio has an open redirect in its oauth flow. Remediation is available by upgrading affected packages to version 6.6.0.

CVE-2026-28415 at a Glance

CVE Identifier CVE-2026-28415
GHSA Identifier GHSA-pfjf-5gxr-995x
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-284: Improper Access Control
Affected Product Gradio
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-28415

To remediate this vulnerability, upgrade all affected Gradio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gradio fixed: 6.6.0
pip install gradio>=6.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show gradio

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-28415, inspect your installed packages using pip:

pip show gradio

Analyze the terminal output to locate any version of Gradio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.6.0), your application is affected.

Note: The pip show gradio command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Gradio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# 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.

CVE-2026-28415 Affected Gradio Versions

1 component(s)
Fixed Versions:
6.6.0
Product / Package Ecosystem Affected Versions Fixed Version
gradio
PyPI
< 6.6.0
6.6.0

References

Frequently Asked Questions

What is CVE-2026-28415?
CVE-2026-28415 is a security vulnerability in Gradio involving Gradio has an Open Redirect in its OAuth Flow under CWE-284: Improper Access Control.
Which Gradio versions are affected?
Affected versions include releases prior to 6.6.0 across affected packages: gradio.
What version fixes CVE-2026-28415?
Upgrading to 6.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gradio affected?
Yes, gradio is affected in releases prior to 6.6.0. Upgrade your dependency to 6.6.0 or later.
What is the CVSS score of CVE-2026-28415?
CVE-2026-28415 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-28415?
CVE-2026-28415 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2026-28415?
Run the dependency tree command: 'pip show gradio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pfjf-5gxr-995x",
  "modified" : "2026-06-06T00:22:30Z",
  "published" : "2026-03-01T01:29:12Z",
  "aliases" : [ "CVE-2026-28415" ],
  "summary" : "Gradio has an Open Redirect in its OAuth Flow",
  "details" : "# Summary\n\nThe _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).\n\n## Details\n\n```python\n\n  def _redirect_to_target(request, default_target=\"/\"):\n      target = request.query_params.get(\"_target_url\", default_target)\n      return RedirectResponse(target)  # No validation\n```\n  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.\n\n## Impact\n\nPhishing — an attacker can use the trusted domain to redirect users to a malicious site. No direct data exposure or server-side impact.\n\n ## Fix\nThe _target_url parameter is now sanitized to only use the path, query, and fragment, stripping any scheme or host.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "gradio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/security/advisories/GHSA-pfjf-5gxr-995x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-28415"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/commit/dfee0da06d0aa94b3c2684131e7898d5d5c1911e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gradio-app/gradio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/releases/tag/gradio%406.6.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2026-65.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-284", "CWE-330", "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-01T01:29:12Z",
    "nvd_published_at" : "2026-02-27T22:16:24Z"
  }
}