CVE-2023-25823: Gradio: hardcoded SSH key leaks via share=True demos
CRITICAL PoC AVAILABLEEvery ML engineer using Gradio's share=True feature has been transmitting a private SSH key to every visitor since before February 2023 — granting attackers lateral access across all shared Gradio instances on the same FRP infrastructure. Patch to 3.19.1+ immediately, rotate any exposed SSH keys, and audit connection logs. Disable share=True in any environment that touches production data or models.
Risk Assessment
Critically high. CVSS 9.8 with no authentication, privileges, or user interaction required — exploitation is passive and requires only connecting to a public share link. Gradio share=True is pervasively used across ML teams for demos, research prototypes, and Hugging Face Spaces, making blast radius extremely high. Despite being patched in 2023, version lag in ML tooling environments is common, and many deployments likely remain vulnerable.
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-
Upgrade Gradio to 3.19.1+ immediately (minimum: 3.13.1).
-
Rotate all SSH keys on systems that ran vulnerable Gradio versions.
-
Audit FRP connection logs for unauthorized lateral access.
-
Replace share=True with hardened tunneling (Cloudflare Tunnel, nginx reverse proxy with auth).
-
Isolate ML demo environments from production infrastructure and model registries.
-
Block outbound FRP connections at the perimeter firewall if share feature is unused.
-
Inventory all Gradio deployments including transitive dependencies in ML pipelines.
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-25823?
Every ML engineer using Gradio's share=True feature has been transmitting a private SSH key to every visitor since before February 2023 — granting attackers lateral access across all shared Gradio instances on the same FRP infrastructure. Patch to 3.19.1+ immediately, rotate any exposed SSH keys, and audit connection logs. Disable share=True in any environment that touches production data or models.
Is CVE-2023-25823 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2023-25823, increasing the risk of exploitation.
How to fix CVE-2023-25823?
1. Upgrade Gradio to 3.19.1+ immediately (minimum: 3.13.1). 2. Rotate all SSH keys on systems that ran vulnerable Gradio versions. 3. Audit FRP connection logs for unauthorized lateral access. 4. Replace share=True with hardened tunneling (Cloudflare Tunnel, nginx reverse proxy with auth). 5. Isolate ML demo environments from production infrastructure and model registries. 6. Block outbound FRP connections at the perimeter firewall if share feature is unused. 7. Inventory all Gradio deployments including transitive dependencies in ML pipelines.
What systems are affected by CVE-2023-25823?
This vulnerability affects the following AI/ML architecture patterns: ML demo environments, model serving, data science notebooks.
What is the CVSS score for CVE-2023-25823?
CVE-2023-25823 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.41%.
Technical Details
NVD Description
Gradio is an open-source Python library to build machine learning and data science demos and web applications. Versions prior to 3.13.1 contain Use of Hard-coded Credentials. When using Gradio's share links (i.e. creating a Gradio app and then setting `share=True`), a private SSH key is sent to any user that connects to the Gradio machine, which means that a user could access other users' shared Gradio demos. From there, other exploits are possible depending on the level of access/exposure the Gradio app provides. This issue is patched in version 3.13.1, however, users are recommended to update to 3.19.1 or later where the FRP solution has been properly tested.
Exploitation Scenario
Attacker finds a public Gradio share link (trivially discoverable via GitHub READMEs, social media, or search indexing of gradio.live URLs). On connecting, the vulnerable Gradio instance transmits its SSH private key. Attacker authenticates to the shared FRP server using this key and enumerates other active Gradio sessions on the same infrastructure. From there, they can observe model inputs/outputs in real time, extract model artifacts, harvest API keys from environment variables, or use exposed compute for cryptomining or further lateral movement. The attack leaves minimal forensic trace as no authentication failure occurs.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 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-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 CVE-2023-34239 9.1 Gradio: path traversal + SSRF exposes model files & infra
Same package: gradio
AI Threat Alert