CVE-2026-28415: Gradio has an Open Redirect in its 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).
Published Mar 1, 2026 · Updated Jun 6, 2026
Affected packages
gradio
- Ecosystem
- PyPI
- Affected
- < 6.6.0
- Fixed in
- 6.6.0
- Check
pip show gradio
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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 validationAn 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.
Credited to logicx24.
References
- https://github.com/gradio-app/gradio/security/advisories/GHSA-pfjf-5gxr-995x
- https://nvd.nist.gov/vuln/detail/CVE-2026-28415
- https://github.com/gradio-app/gradio/commit/dfee0da06d0aa94b3c2684131e7898d5d5c1911e
- https://github.com/gradio-app/gradio/releases/tag/gradio%406.6.0
- https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2026-65.yaml
- https://github.com/advisories/GHSA-pfjf-5gxr-995x
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Gradio vulnerabilities
All Gradio entriesCVE-2026-49119
Gradio FileExplorer preprocess path traversal allows files outside root_dir to reach callbacks
high7.5Jul 1, 2026CVE-2026-10783
Gradio: Audio cache key ignores metadata when saving numpy audio outputs
low2.5Jun 4, 2026CVE-2026-48545
Gradio contains a cookie injection vulnerability
high6.8May 27, 2026CVE-2026-27167
Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
lowMar 1, 2026CVE-2026-28414
Gradio is Vulnerable to Absolute Path Traversal on Windows with Python 3.13+
high7.5Mar 1, 2026CVE-2026-28416
Gradio has SSRF via Malicious `proxy_url` Injection in `gr.load()` Config Processing
high8.2Mar 1, 2026
