CVE-2023-6572: Gradio: command injection enables RCE on ML servers
HIGHPoC 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.
What is the risk?
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.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Gradio | pip | — | No patch |
Do you use Gradio? You're affected.
How severe is it?
What is the attack surface?
What should I do?
7 stepsPATCH
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.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
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 1.68%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0025Exfiltration via Cyber MeansAML.T0035AI Artifact CollectionAML.T0049Exploit Public-Facing ApplicationAML.T0050Command and Scripting InterpreterAML.T0072Reverse ShellCompliance Controls Affected
What are the technical details?
Original Advisory
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.
Weaknesses (CWE)
CWE-77Improper Neutralization of Special Elements used in a CommandCWE-77Improper Neutralization of Special Elements used in a CommandCWE-77 — Improper Neutralization of Special Elements used in a Command: The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.
- [Architecture and Design] If at all possible, use library calls rather than external processes to recreate the desired functionality.
- [Implementation] If possible, ensure that all external commands called from the program are statically created.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:NReferences
Timeline
Related Vulnerabilities
CVE-2024-471679.8Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradioCVE-2024-392369.8Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradioCVE-2023-258239.8Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradioCVE-2024-09649.4Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradioCVE-2023-342399.1Gradio: path traversal + SSRF exposes model files & infra
Same package: gradio