CVE-2024-47167: Gradio: unauthenticated SSRF in /queue/join, internal pivot
GHSA-576c-3j53-r9jj CRITICALAny Gradio instance below v5.0.0 exposes your internal network to unauthenticated SSRF — no credentials needed, no user interaction required. This is particularly dangerous in ML environments where Gradio demos often run on hosts with access to model APIs, S3 buckets, cloud metadata endpoints, and internal tooling. Upgrade to gradio>=5 immediately and audit every Gradio deployment for network exposure.
Risk Assessment
CVSS 9.8 with network-accessible, zero-auth, zero-interaction attack vector makes this a drop-everything patch. Despite low EPSS (0.00236), SSRF exploits are commodity-level — any script kiddie can abuse this. The real multiplier is deployment context: ML teams routinely run Gradio on cloud VMs with access to IMDSv1 metadata (AWS 169.254.169.254), internal model registries, and data pipelines. A single compromised Gradio instance can cascade into full cloud credential theft or internal network lateral movement.
Affected Systems
Severity & Risk
Attack Surface
Recommended Action
5 steps-
PATCH
Upgrade to gradio>=5.0.0 — this is the only complete fix.
-
IMMEDIATE WORKAROUND
Implement allowlist-based URL validation restricting inputs to trusted domains only; block all RFC1918 addresses and link-local ranges (169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16).
-
NETWORK CONTROL
Apply egress filtering on hosts running Gradio to block outbound HTTP to internal subnets.
-
DETECTION
Monitor for outbound HTTP requests from Gradio processes to internal IPs or metadata endpoints; alert on file writes to cache directories from unexpected URL sources.
-
INVENTORY
Identify all Gradio instances — pay special attention to cloud-hosted VMs and internal demo environments.
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-47167?
Any Gradio instance below v5.0.0 exposes your internal network to unauthenticated SSRF — no credentials needed, no user interaction required. This is particularly dangerous in ML environments where Gradio demos often run on hosts with access to model APIs, S3 buckets, cloud metadata endpoints, and internal tooling. Upgrade to gradio>=5 immediately and audit every Gradio deployment for network exposure.
Is CVE-2024-47167 actively exploited?
No confirmed active exploitation of CVE-2024-47167 has been reported, but organizations should still patch proactively.
How to fix CVE-2024-47167?
1. PATCH: Upgrade to gradio>=5.0.0 — this is the only complete fix. 2. IMMEDIATE WORKAROUND: Implement allowlist-based URL validation restricting inputs to trusted domains only; block all RFC1918 addresses and link-local ranges (169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). 3. NETWORK CONTROL: Apply egress filtering on hosts running Gradio to block outbound HTTP to internal subnets. 4. DETECTION: Monitor for outbound HTTP requests from Gradio processes to internal IPs or metadata endpoints; alert on file writes to cache directories from unexpected URL sources. 5. INVENTORY: Identify all Gradio instances — pay special attention to cloud-hosted VMs and internal demo environments.
What systems are affected by CVE-2024-47167?
This vulnerability affects the following AI/ML architecture patterns: ML prototyping and demo environments, Model evaluation UIs, Internal MLOps tooling, Model serving interfaces, AI application backends on cloud VMs.
What is the CVSS score for CVE-2024-47167?
CVE-2024-47167 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.24%.
Technical Details
NVD Description
Gradio is an open-source Python package designed for quick prototyping. This vulnerability relates to **Server-Side Request Forgery (SSRF)** in the `/queue/join` endpoint. Gradio’s `async_save_url_to_cache` function allows attackers to force the Gradio server to send HTTP requests to user-controlled URLs. This could enable attackers to target internal servers or services within a local network and possibly exfiltrate data or cause unwanted internal requests. Additionally, the content from these URLs is stored locally, making it easier for attackers to upload potentially malicious files to the server. This impacts users deploying Gradio servers that use components like the Video component which involve URL fetching. Users are advised to upgrade to `gradio>=5` to address this issue. As a workaround, users can disable or heavily restrict URL-based inputs in their Gradio applications to trusted domains only. Additionally, implementing stricter URL validation (such as allowinglist-based validation) and ensuring that local or internal network addresses cannot be requested via the `/queue/join` endpoint can help mitigate the risk of SSRF attacks.
Exploitation Scenario
Attacker identifies an internet-facing Gradio deployment (common for model demos, AI hackathons, internal ML tooling). They POST to `/queue/join` with a crafted payload containing a URL pointing to `http://169.254.169.254/latest/meta-data/iam/security-credentials/` (AWS IMDS). Gradio's `async_save_url_to_cache` fetches the URL server-side and stores the response locally. Attacker retrieves the cached file containing IAM temporary credentials, then pivots to AWS APIs with full role permissions — exfiltrating training data, accessing model artifacts in S3, or escalating to broader cloud infrastructure.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2024-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
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 CVE-2024-4253 9.1 Gradio: CI/CD command injection enables secrets exfiltration
Same package: gradio
AI Threat Alert