CVE-2024-1727: Gradio: CSRF enables disk exhaustion via file upload DoS
UNKNOWN PoC AVAILABLE CISA: TRACK*Teams running Gradio locally for ML demos or model prototyping are exposed to denial-of-service via disk exhaustion if a researcher visits a malicious webpage. Patch to the fixed commit immediately and restrict Gradio server binding to localhost-only with no external network exposure. Risk is highest in shared ML dev environments where disk exhaustion can disrupt CI/CD pipelines and active training jobs.
Risk Assessment
Medium risk for ML development environments. The CSRF exploit is trivial—no AI knowledge required—but impact is bounded to local or intranet-accessible Gradio instances. In shared ML infrastructure such as JupyterHub or team dev servers, the blast radius expands significantly as disk exhaustion can halt multiple users and running workloads simultaneously. No active exploitation reported and no CISA KEV listing, but the attack surface is broad given Gradio's widespread adoption in the ML community.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| gradio | pip | — | No patch |
Do you use gradio? You're affected.
Severity & Risk
Recommended Action
5 steps-
Patch: update to commit 84802ee6a4806c25287344dce581f9548a99834a or the corresponding patched Gradio release.
-
Restrict binding: launch Gradio with --server_name 127.0.0.1 to prevent any network access beyond localhost.
-
Add upload rate limiting and maximum file size caps at the reverse proxy or application level.
-
Monitor disk usage on ML dev servers with alerting on anomalous rapid consumption in upload or temp directories.
-
Audit firewall rules to ensure no Gradio ports (default 7860) are inadvertently exposed. Detection: watch for high-frequency POST requests to /upload endpoints from unexpected origins.
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-1727?
Teams running Gradio locally for ML demos or model prototyping are exposed to denial-of-service via disk exhaustion if a researcher visits a malicious webpage. Patch to the fixed commit immediately and restrict Gradio server binding to localhost-only with no external network exposure. Risk is highest in shared ML dev environments where disk exhaustion can disrupt CI/CD pipelines and active training jobs.
Is CVE-2024-1727 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2024-1727, increasing the risk of exploitation.
How to fix CVE-2024-1727?
1. Patch: update to commit 84802ee6a4806c25287344dce581f9548a99834a or the corresponding patched Gradio release. 2. Restrict binding: launch Gradio with --server_name 127.0.0.1 to prevent any network access beyond localhost. 3. Add upload rate limiting and maximum file size caps at the reverse proxy or application level. 4. Monitor disk usage on ML dev servers with alerting on anomalous rapid consumption in upload or temp directories. 5. Audit firewall rules to ensure no Gradio ports (default 7860) are inadvertently exposed. Detection: watch for high-frequency POST requests to /upload endpoints from unexpected origins.
What systems are affected by CVE-2024-1727?
This vulnerability affects the following AI/ML architecture patterns: ML development environments, model demo/prototyping, local model serving.
What is the CVSS score for CVE-2024-1727?
No CVSS score has been assigned yet.
Technical Details
NVD Description
A Cross-Site Request Forgery (CSRF) vulnerability in gradio-app/gradio allows attackers to upload multiple large files to a victim's system if they are running Gradio locally. By crafting a malicious HTML page that triggers an unauthorized file upload to the victim's server, an attacker can deplete the system's disk space, potentially leading to a denial of service. This issue affects the file upload functionality as implemented in gradio/routes.py.
Exploitation Scenario
An attacker hosts a malicious HTML page containing JavaScript that silently fires multiple large file upload POST requests to http://localhost:7860/upload—Gradio's default endpoint—the moment a victim visits the page. No authentication is required due to the absent CSRF token validation. The victim, likely an ML engineer with a local Gradio demo running, has their disk progressively filled until the system becomes unresponsive, interrupting active model training, corrupting in-progress experiments, or crashing shared infrastructure. The entire attack is invisible to the victim and requires only one page visit.
Weaknesses (CWE)
References
- github.com/gradio-app/gradio/commit/84802ee6a4806c25287344dce581f9548a99834a Patch
- huntr.com/bounties/a94d55fb-0770-4cbe-9b20-97a978a2ffff Exploit 3rd Party
- github.com/20142995/nuclei-templates Exploit
- github.com/NaInSec/CVE-LIST Exploit
- github.com/cyb3r-w0lf/nuclei-template-collection Exploit
- github.com/leoambrus/artefactswithoutCVEonGitHubAdvisoryDatabase Exploit
Timeline
Related Vulnerabilities
CVE-2023-25823 9.8 Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradio 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-2024-0964 9.4 Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradio CVE-2024-4253 9.1 Gradio: CI/CD command injection enables secrets exfiltration
Same package: gradio
AI Threat Alert