CVE-2023-6572: Gradio: command injection enables RCE on ML servers

HIGH PoC AVAILABLE
Published December 14, 2023
CISO Take

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.

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
43.0K OpenSSF 5.6 685 dependents Pushed 4d ago 26% patched ~110d to patch Full package profile →

Do you use Gradio? You're affected.

How severe is it?

CVSS 3.1
8.1 / 10
EPSS
1.7%
chance of exploitation in 30 days
Higher than 74% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR Low
UI None
S Unchanged
C High
I High
A None

What should I do?

7 steps
  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 does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact total

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:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
8.2 - AI system risk assessment 9.1 - Monitoring, measurement, analysis and evaluation
NIST AI RMF
MANAGE 2.2 - Mechanisms to sustain AI system resilience
OWASP LLM Top 10
LLM07 - Insecure Plugin Design

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.71%.

What is the AI security impact?

Affected AI Architectures

model servinginference endpointsagent frameworkstraining pipelinesML experimentation environments

MITRE ATLAS Techniques

AML.T0025 Exfiltration via Cyber Means
AML.T0035 AI Artifact Collection
AML.T0049 Exploit Public-Facing Application
AML.T0050 Command and Scripting Interpreter
AML.T0072 Reverse Shell

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: 8.2, 9.1
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM07

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-77 — Improper Neutralization of Special Elements used in a Command ('Command Injection'): 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:N

Timeline

Published
December 14, 2023
Last Modified
November 21, 2024
First Seen
December 14, 2023

Related Vulnerabilities