CVE-2024-34510: Gradio: credential leakage via Windows path encoding bug
GHSA-rvfh-h6c7-fc3c HIGH PoC AVAILABLEGradio 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?
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Patch: Upgrade Gradio to >= 4.20.0 immediately.
-
Rotate credentials: Assume any secrets accessible to Gradio processes on Windows pre-4.20 are compromised—rotate API keys, tokens, and connection strings.
-
Audit exposure: Identify all Windows-based Gradio instances, especially those internet-exposed or using tunneling tools.
-
Detect: Review access logs for unexpected requests to Gradio endpoints that could indicate credential harvesting.
-
Harden: Never store production secrets as environment variables on hosts running public-facing Gradio demos; use a secrets manager.
-
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?
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-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
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
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
Primary
CWE-116 Improper Encoding or Escaping of Output 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 References
Timeline
Related Vulnerabilities
CVE-2024-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradio CVE-2024-47167 9.8 Gradio: unauthenticated SSRF in /queue/join, internal pivot
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-2024-4253 9.1 Gradio: CI/CD command injection enables secrets exfiltration
Same package: gradio