CVE-2024-47868: Gradio: path traversal leaks arbitrary server files
GHSA-4q3c-cj7g-jcwf HIGH PoC AVAILABLEAny Gradio deployment older than v5.0.0 with network exposure is vulnerable to unauthenticated arbitrary file reads — including SSH keys, API credentials, and model configs. Upgrade to Gradio ≥5.0.0 immediately; no workarounds exist. Audit every Gradio instance in your environment including internal ML demos, inference UIs, and Hugging Face Spaces — then rotate credentials on any instance that was publicly accessible.
Risk Assessment
High severity (CVSS 7.5) with near-zero exploitation complexity: no authentication, no user interaction, network-accessible, low attack complexity. EPSS is currently low (0.2%) but Gradio's ubiquity in ML prototyping pipelines and the trivial exploit mechanics make this a high-priority patch target. Risk compounds significantly when instances are internet-facing or when combined with TOB-GRADIO-15. Primary at-risk assets are cloud API keys, SSH private keys, and proprietary model artifacts stored server-side.
Affected Systems
Severity & Risk
Attack Surface
Recommended Action
5 steps-
PATCH
Upgrade all Gradio deployments to ≥5.0.0 — no workarounds exist per the advisory.
-
AUDIT
Inventory all Gradio instances by scanning requirements.txt, pyproject.toml, and Pipfile across repos and CI/CD pipelines.
-
ISOLATE
Until patched, restrict Gradio endpoint access via firewall rules or VPN; remove all public exposure.
-
ROTATE
If an instance was publicly accessible at any point, assume server-side credentials are compromised — rotate API keys, SSH keys, and database passwords immediately.
-
DETECT
Review web access logs for path traversal patterns (../, %2f, /etc/, /root/, /.ssh/, /.env) targeting Gradio API and component endpoints.
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-2024-47868?
Any Gradio deployment older than v5.0.0 with network exposure is vulnerable to unauthenticated arbitrary file reads — including SSH keys, API credentials, and model configs. Upgrade to Gradio ≥5.0.0 immediately; no workarounds exist. Audit every Gradio instance in your environment including internal ML demos, inference UIs, and Hugging Face Spaces — then rotate credentials on any instance that was publicly accessible.
Is CVE-2024-47868 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2024-47868, increasing the risk of exploitation.
How to fix CVE-2024-47868?
1. PATCH: Upgrade all Gradio deployments to ≥5.0.0 — no workarounds exist per the advisory. 2. AUDIT: Inventory all Gradio instances by scanning requirements.txt, pyproject.toml, and Pipfile across repos and CI/CD pipelines. 3. ISOLATE: Until patched, restrict Gradio endpoint access via firewall rules or VPN; remove all public exposure. 4. ROTATE: If an instance was publicly accessible at any point, assume server-side credentials are compromised — rotate API keys, SSH keys, and database passwords immediately. 5. DETECT: Review web access logs for path traversal patterns (../, %2f, /etc/, /root/, /.ssh/, /.env) targeting Gradio API and component endpoints.
What systems are affected by CVE-2024-47868?
This vulnerability affects the following AI/ML architecture patterns: ML UI/demo interfaces, model serving, inference APIs, internal ML tooling, agent frameworks.
What is the CVSS score for CVE-2024-47868?
CVE-2024-47868 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.20%.
Technical Details
NVD Description
Gradio is an open-source Python package designed for quick prototyping. This is a **data validation vulnerability** affecting several Gradio components, which allows arbitrary file leaks through the post-processing step. Attackers can exploit these components by crafting requests that bypass expected input constraints. This issue could lead to sensitive files being exposed to unauthorized users, especially when combined with other vulnerabilities, such as issue TOB-GRADIO-15. The components most at risk are those that return or handle file data. Vulnerable Components: 1. **String to FileData:** DownloadButton, Audio, ImageEditor, Video, Model3D, File, UploadButton. 2. **Complex data to FileData:** Chatbot, MultimodalTextbox. 3. **Direct file read in preprocess:** Code. 4. **Dictionary converted to FileData:** ParamViewer, Dataset. Exploit Scenarios: 1. A developer creates a Dropdown list that passes values to a DownloadButton. An attacker bypasses the allowed inputs, sends an arbitrary file path (like `/etc/passwd`), and downloads sensitive files. 2. An attacker crafts a malicious payload in a ParamViewer component, leaking sensitive files from a server through the arbitrary file leak. This issue has been resolved in `gradio>5.0`. Upgrading to the latest version will mitigate this vulnerability. There are no known workarounds for this vulnerability.
Exploitation Scenario
An attacker enumerates publicly accessible Gradio inference UIs (common in ML teams using them for demos or internal tooling). They identify a DownloadButton or Chatbot component endpoint and craft a POST request substituting the expected file path with '/app/.env' or '/home/user/.ssh/id_rsa'. The server's post-processing step returns file contents without path validation. The attacker harvests cloud API keys (OpenAI, AWS, GCP) to pivot into cloud infrastructure or exfiltrate proprietary model weights, then uses recovered SSH keys for persistent server access — all without authentication.
Weaknesses (CWE)
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-2023-25823 9.8 Gradio: hardcoded SSH key leaks via share=True demos
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-2023-34239 9.1 Gradio: path traversal + SSRF exposes model files & infra
Same package: gradio
AI Threat Alert