CVE-2024-34510: Gradio: credential leakage via Windows path encoding bug

GHSA-rvfh-h6c7-fc3c HIGH PoC AVAILABLE
Published May 5, 2024
CISO Take

Gradio deployments on Windows prior to 4.20 expose credentials—API keys, tokens, secrets—to unauthenticated remote attackers due to improper output encoding. Patch immediately to 4.20.0 or later; any Windows-based Gradio instance should be treated as potentially compromised. Rotate all secrets accessible to affected Gradio processes.

What is the risk?

CVSS 7.5 High with AV:N/AC:L/PR:N/UI:N makes this trivially exploitable remotely with no authentication. The EPSS of 0.00092 suggests limited observed exploitation, but the zero-friction attack profile and the sensitivity of credentials in ML environments (LLM API keys, HuggingFace tokens, cloud credentials) elevate real-world risk well above base scores imply. Windows-hosted Gradio demos exposed to the internet are the highest-risk targets.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
Gradio pip No patch
43.0K OpenSSF 5.6 685 dependents Pushed 5d ago 26% patched ~110d to patch Full package profile →
Gradio pip < 4.20.0 4.20.0
43.0K OpenSSF 5.6 685 dependents Pushed 5d ago 26% patched ~110d to patch Full package profile →

How severe is it?

CVSS 3.1
7.5 / 10
EPSS
0.6%
chance of exploitation in 30 days
Higher than 43% 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 None
UI None
S Unchanged
C High
I None
A None

What should I do?

6 steps
  1. Patch: Upgrade Gradio to >= 4.20.0 immediately.

  2. Rotate credentials: Assume any secrets accessible to Gradio processes on Windows pre-4.20 are compromised—rotate API keys, tokens, and connection strings.

  3. Audit exposure: Identify all Windows-based Gradio instances, especially those internet-exposed or using tunneling tools.

  4. Detect: Review access logs for unexpected requests to Gradio endpoints that could indicate credential harvesting.

  5. Harden: Never store production secrets as environment variables on hosts running public-facing Gradio demos; use a secrets manager.

  6. Isolate: Run Gradio demos in isolated environments (containers, VMs) with least-privilege credentials scoped only to what the demo needs.

What does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact partial

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
Art. 15 - Accuracy, robustness and cybersecurity of high-risk AI systems
ISO 42001
A.8.24 - Use of cryptography and secrets management A.9.4 - System and application access control
NIST AI RMF
GOVERN-1.7 - Processes for AI risk management include security considerations MANAGE-2.4 - Mechanisms for AI vulnerability management
OWASP LLM Top 10
LLM08 - Excessive Agency / Sensitive Information Disclosure

Frequently Asked Questions

What is CVE-2024-34510?

Gradio deployments on Windows prior to 4.20 expose credentials—API keys, tokens, secrets—to unauthenticated remote attackers due to improper output encoding. Patch immediately to 4.20.0 or later; any Windows-based Gradio instance should be treated as potentially compromised. Rotate all secrets accessible to affected Gradio processes.

Is CVE-2024-34510 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2024-34510, increasing the risk of exploitation.

How to fix CVE-2024-34510?

1. Patch: Upgrade Gradio to >= 4.20.0 immediately. 2. Rotate credentials: Assume any secrets accessible to Gradio processes on Windows pre-4.20 are compromised—rotate API keys, tokens, and connection strings. 3. Audit exposure: Identify all Windows-based Gradio instances, especially those internet-exposed or using tunneling tools. 4. Detect: Review access logs for unexpected requests to Gradio endpoints that could indicate credential harvesting. 5. Harden: Never store production secrets as environment variables on hosts running public-facing Gradio demos; use a secrets manager. 6. Isolate: Run Gradio demos in isolated environments (containers, VMs) with least-privilege credentials scoped only to what the demo needs.

What systems are affected by CVE-2024-34510?

This vulnerability affects the following AI/ML architecture patterns: ML demo platforms, model serving, agent frameworks, inference APIs.

What is the CVSS score for CVE-2024-34510?

CVE-2024-34510 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.57%.

What is the AI security impact?

Affected AI Architectures

ML demo platformsmodel servingagent frameworksinference APIs

MITRE ATLAS Techniques

AML.T0025 Exfiltration via Cyber Means
AML.T0049 Exploit Public-Facing Application
AML.T0055 Unsecured Credentials
AML.T0083 Credentials from AI Agent Configuration
AML.T0106 Exploitation for Credential Access

Compliance Controls Affected

EU AI Act: Art. 15
ISO 42001: A.8.24, A.9.4
NIST AI RMF: GOVERN-1.7, MANAGE-2.4
OWASP LLM Top 10: LLM08

What are the technical details?

Original Advisory

Gradio before 4.20 allows credential leakage on Windows.

Exploitation Scenario

An adversary scans for public Gradio instances (via Shodan, Censys, or targeted recon on ML teams). They find a Windows-hosted Gradio deployment running a GPT-4 or Claude-powered demo. Due to CWE-116 (improper output encoding specific to Windows path handling), a crafted HTTP request causes Gradio to include improperly encoded credential material in its response—leaking the OpenAI API key, HuggingFace token, or cloud credentials embedded in the process environment. The attacker extracts the keys with no authentication, then uses them for LLM API abuse, unauthorized model access, or pivots to cloud infrastructure.

Weaknesses (CWE)

CWE-116 — Improper Encoding or Escaping of Output: The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.

  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using the ESAPI Encoding control [REF-45] or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error. Alternately, use built-in functions, but consider using wrappers in case those functions are discovered to have a vulnerability.
  • [Architecture and Design] If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated. For example, stored procedures can enforce database query structure and reduce the likelihood of SQL injection.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Timeline

Published
May 5, 2024
Last Modified
June 17, 2025
First Seen
May 5, 2024

Related Vulnerabilities