CVE-2024-8021: Gradio: open redirect exposes AI demo users to phishing
GHSA-7v2w-h4gh-w5cv MEDIUM PoC AVAILABLE CISA: TRACK*Gradio is the de facto standard for ML model demos and internal AI tooling UIs — if your teams expose Gradio publicly, attackers can craft URLs that silently redirect users to malicious sites after interacting with your app. Upgrade to a patched version immediately; if no patch is available for 4.37.2, restrict public access or add a reverse proxy with redirect validation. Risk is moderate but real: AI demo environments are soft targets with trusting internal users.
Risk Assessment
CVSS 6.1 understates operational risk in AI contexts. Gradio is pervasively deployed as public-facing model demos and shared internally across data science teams — users have high trust in these URLs. Open redirect (CWE-601) is trivially exploitable with no auth required, and URL-encoding bypass suggests basic WAF evasion is built-in. EPSS 0.027 reflects low active exploitation today, but the attack surface (public ML demos, Hugging Face Spaces, internal tooling) is large. No patch version listed for pip package as of CVE publish date is a concern.
Affected Systems
Severity & Risk
Attack Surface
Recommended Action
5 steps-
PATCH
Upgrade gradio beyond 4.37.2 — check PyPI for latest patched release (no fixed version listed in NVD as of publish date; monitor huntr advisory for patch confirmation).
-
WORKAROUND
If patching is blocked, deploy a reverse proxy (nginx/Cloudflare) with an allowlist of permitted redirect destinations.
-
RESTRICT
Remove public access to Gradio instances not intended for external use; enforce auth via SSO.
-
DETECT
Audit logs for 302 responses from Gradio endpoints containing encoded URL parameters (%2F, %3A patterns). Alert on redirects to external domains.
-
INVENTORY
Run 'pip show gradio' across ML workstations and CI environments to identify affected versions.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2024-8021?
Gradio is the de facto standard for ML model demos and internal AI tooling UIs — if your teams expose Gradio publicly, attackers can craft URLs that silently redirect users to malicious sites after interacting with your app. Upgrade to a patched version immediately; if no patch is available for 4.37.2, restrict public access or add a reverse proxy with redirect validation. Risk is moderate but real: AI demo environments are soft targets with trusting internal users.
Is CVE-2024-8021 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2024-8021, increasing the risk of exploitation.
How to fix CVE-2024-8021?
1. PATCH: Upgrade gradio beyond 4.37.2 — check PyPI for latest patched release (no fixed version listed in NVD as of publish date; monitor huntr advisory for patch confirmation). 2. WORKAROUND: If patching is blocked, deploy a reverse proxy (nginx/Cloudflare) with an allowlist of permitted redirect destinations. 3. RESTRICT: Remove public access to Gradio instances not intended for external use; enforce auth via SSO. 4. DETECT: Audit logs for 302 responses from Gradio endpoints containing encoded URL parameters (%2F, %3A patterns). Alert on redirects to external domains. 5. INVENTORY: Run 'pip show gradio' across ML workstations and CI environments to identify affected versions.
What systems are affected by CVE-2024-8021?
This vulnerability affects the following AI/ML architecture patterns: ML model serving UIs, AI demo environments, Internal AI tooling portals, Agent frameworks with Gradio frontends.
What is the CVSS score for CVE-2024-8021?
CVE-2024-8021 has a CVSS v3.1 base score of 6.1 (MEDIUM). The EPSS exploitation probability is 2.45%.
Technical Details
NVD Description
An open redirect vulnerability exists in the latest version of gradio-app/gradio. The vulnerability allows an attacker to redirect users to a malicious website by URL encoding. This can be exploited by sending a crafted request to the application, which results in a 302 redirect to an attacker-controlled site.
Exploitation Scenario
Attacker identifies a public Gradio-based model demo (e.g., via Shodan, Hugging Face Spaces, or a company's public AI showcase). They craft a URL like `https://legitimate-ai-demo.company.com/redirect?url=https%3A%2F%2Fattacker.com%2Fharvest` and send it via phishing email or Slack to data scientists or ML engineers with existing trust in that domain. User clicks, interacts briefly with what appears to be the real app, then gets silently 302-redirected to a credential-harvesting clone of an internal SSO page or AI tool. Given that AI/ML teams routinely share Gradio demo links, this social engineering vector has high success probability.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N References
Timeline
Related Vulnerabilities
CVE-2024-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradio CVE-2024-47167 9.8 Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradio CVE-2023-25823 9.8 Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradio CVE-2024-0964 9.4 Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradio CVE-2023-34239 9.1 Gradio: path traversal + SSRF exposes model files & infra
Same package: gradio
AI Threat Alert