CVE-2024-4325: Gradio: SSRF exposes internal network and cloud metadata
HIGH ACTIVELY EXPLOITED PoC AVAILABLE NUCLEI TEMPLATEAny internet-facing Gradio deployment (v4.21.0) is vulnerable to unauthenticated SSRF that can reach AWS/GCP/Azure instance metadata endpoints, enabling IAM credential theft and lateral movement. Patch immediately or block public access; treat any cloud-hosted Gradio instance as potentially compromised. This is especially urgent for ML teams exposing model demos on cloud infrastructure.
Risk Assessment
HIGH. No authentication required, low attack complexity, and exploitable remotely at scale make this trivially weaponizable. The scope change (C:H, S:C in CVSS) reflects that successful exploitation escapes the application boundary into cloud infrastructure. Gradio is pervasively used for AI/ML demos and internal tooling, significantly broadening the attack surface. AWS IMDS v1 (no session token required) is particularly vulnerable.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| gradio | pip | — | No patch |
Do you use gradio? You're affected.
Severity & Risk
Attack Surface
Recommended Action
1 step-
1) Upgrade Gradio to a version past 4.21.0 with the SSRF fix applied. 2) Block outbound requests to 169.254.169.254 and 169.254.169.254/latest/meta-data at the host/network firewall level. 3) If patching is not immediate, disable the /queue/join endpoint or deploy a WAF rule blocking URLs targeting RFC1918 and link-local ranges in request bodies. 4) Rotate any IAM credentials associated with Gradio-hosting instances. 5) Enable IMDSv2 (session-token required) on all EC2 instances as defense-in-depth. 6) Audit logs for requests to metadata IPs originating from Gradio processes.
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-4325?
Any internet-facing Gradio deployment (v4.21.0) is vulnerable to unauthenticated SSRF that can reach AWS/GCP/Azure instance metadata endpoints, enabling IAM credential theft and lateral movement. Patch immediately or block public access; treat any cloud-hosted Gradio instance as potentially compromised. This is especially urgent for ML teams exposing model demos on cloud infrastructure.
Is CVE-2024-4325 actively exploited?
Yes, CVE-2024-4325 is confirmed actively exploited and listed in CISA Known Exploited Vulnerabilities catalog.
How to fix CVE-2024-4325?
1) Upgrade Gradio to a version past 4.21.0 with the SSRF fix applied. 2) Block outbound requests to 169.254.169.254 and 169.254.169.254/latest/meta-data at the host/network firewall level. 3) If patching is not immediate, disable the /queue/join endpoint or deploy a WAF rule blocking URLs targeting RFC1918 and link-local ranges in request bodies. 4) Rotate any IAM credentials associated with Gradio-hosting instances. 5) Enable IMDSv2 (session-token required) on all EC2 instances as defense-in-depth. 6) Audit logs for requests to metadata IPs originating from Gradio processes.
What systems are affected by CVE-2024-4325?
This vulnerability affects the following AI/ML architecture patterns: model serving, ML demo platforms, inference APIs, cloud-deployed AI applications, internal ML tooling.
What is the CVSS score for CVE-2024-4325?
CVE-2024-4325 has a CVSS v3.1 base score of 8.6 (HIGH). The EPSS exploitation probability is 65.09%.
Technical Details
NVD Description
A Server-Side Request Forgery (SSRF) vulnerability exists in the gradio-app/gradio version 4.21.0, specifically within the `/queue/join` endpoint and the `save_url_to_cache` function. The vulnerability arises when the `path` value, obtained from the user and expected to be a URL, is used to make an HTTP request without sufficient validation checks. This flaw allows an attacker to send crafted requests that could lead to unauthorized access to the local network or the AWS metadata endpoint, thereby compromising the security of internal servers.
Exploitation Scenario
An unauthenticated attacker sends a POST request to `/queue/join` with a `path` parameter set to `http://169.254.169.254/latest/meta-data/iam/security-credentials/`. The `save_url_to_cache` function issues the HTTP request without validation, returning the cloud instance's IAM role name. The attacker follows up with a second request to retrieve temporary AWS credentials. With valid AWS keys, the attacker escalates to S3 buckets containing training data, model artifacts, or customer data, and potentially the entire cloud account depending on IAM role permissions.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N References
- huntr.com/bounties/b34f084b-7d14-4f00-bc10-048a3a5aaf88 Exploit 3rd Party
- github.com/ARPSyndicate/cve-scores Exploit
- github.com/fkie-cad/nvd-json-data-feeds Exploit
Timeline
Scanner Template Available
A Nuclei vulnerability scanner template exists for this CVE. You can scan your infrastructure for this vulnerability immediately.
View template on GitHubnuclei -t http/cves/2024/CVE-2024-4325.yaml -u https://target.example.com Related Vulnerabilities
CVE-2024-47167 9.8 Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradio 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
AI Threat Alert