CVE-2023-6572: Gradio: command injection enables RCE on ML servers
HIGH PoC AVAILABLEAny Gradio-based ML interface exposed on your network—internal demos, model UIs, experimentation tools—is a direct shell access vector requiring low privileges and zero user interaction. Patch to post-commit 5b5af18 immediately and treat every Gradio endpoint as a critical asset, not a dev tool. Audit your AI/ML teams now: Gradio deployments are frequently spun up outside normal IT controls.
Risk Assessment
High. CVSS 8.1 understates real-world risk in ML environments where Gradio is routinely deployed with minimal hardening. Network-reachable, low-privilege, zero-click exploitation translates to near-certain compromise for unpatched instances. The ML ecosystem's culture of exposing Gradio publicly for demos dramatically widens the attack surface. Confidentiality and integrity both fully compromised; model weights, training data, and API keys stored on host are at immediate risk.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| gradio | pip | — | No patch |
Do you use gradio? You're affected.
Severity & Risk
Attack Surface
Recommended Action
7 steps-
PATCH
Upgrade Gradio to a version incorporating commit 5b5af1899dd98d63e1f9b48a93601c2db1f56520 immediately.
-
INVENTORY
Enumerate all Gradio instances across teams—shadow IT is common in ML orgs.
-
ISOLATE
Place Gradio instances behind VPN/private networking; remove all public internet exposure unless strictly required.
-
AUTHENTICATE
Enforce authentication before Gradio UI access; disable share=True (public tunnels) in all non-demo contexts.
-
DETECT
Alert on unexpected child process spawning from Gradio/Python processes.
-
AUDIT
Review Gradio deployments for evidence of prior exploitation (unusual processes, new files, outbound connections).
-
HARDEN
Run Gradio in containers with minimal OS privileges and network egress controls.
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-2023-6572?
Any Gradio-based ML interface exposed on your network—internal demos, model UIs, experimentation tools—is a direct shell access vector requiring low privileges and zero user interaction. Patch to post-commit 5b5af18 immediately and treat every Gradio endpoint as a critical asset, not a dev tool. Audit your AI/ML teams now: Gradio deployments are frequently spun up outside normal IT controls.
Is CVE-2023-6572 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2023-6572, increasing the risk of exploitation.
How to fix CVE-2023-6572?
1. PATCH: Upgrade Gradio to a version incorporating commit 5b5af1899dd98d63e1f9b48a93601c2db1f56520 immediately. 2. INVENTORY: Enumerate all Gradio instances across teams—shadow IT is common in ML orgs. 3. ISOLATE: Place Gradio instances behind VPN/private networking; remove all public internet exposure unless strictly required. 4. AUTHENTICATE: Enforce authentication before Gradio UI access; disable share=True (public tunnels) in all non-demo contexts. 5. DETECT: Alert on unexpected child process spawning from Gradio/Python processes. 6. AUDIT: Review Gradio deployments for evidence of prior exploitation (unusual processes, new files, outbound connections). 7. HARDEN: Run Gradio in containers with minimal OS privileges and network egress controls.
What systems are affected by CVE-2023-6572?
This vulnerability affects the following AI/ML architecture patterns: model serving, inference endpoints, agent frameworks, training pipelines, ML experimentation environments.
What is the CVSS score for CVE-2023-6572?
CVE-2023-6572 has a CVSS v3.1 base score of 8.1 (HIGH). The EPSS exploitation probability is 2.45%.
Technical Details
NVD Description
Command Injection in GitHub repository gradio-app/gradio prior to main.
Exploitation Scenario
An attacker with a low-privilege account (or access to a public-facing Gradio demo with no auth) crafts a malicious input payload exploiting the command injection flaw in Gradio's input processing. The injected command executes with the privileges of the Python process hosting the ML model—typically a service account with broad filesystem access. The attacker establishes a reverse shell, extracts model weights and training data, harvests cloud credentials from environment variables, then pivots to cloud infrastructure or CI/CD pipelines. In orgs using Gradio as an agent interface, the same foothold enables prompt injection against downstream LLM calls. The entire chain requires no special ML knowledge—standard command injection tooling suffices.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N References
- github.com/gradio-app/gradio/commit/5b5af1899dd98d63e1f9b48a93601c2db1f56520 Patch
- huntr.com/bounties/21d2ff0c-d43a-4afd-bb4d-049ee8da5b5c Exploit Issue Patch 3rd Party
Timeline
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