CVE-2024-51751: Gradio: path traversal exposes arbitrary server files
GHSA-rhm9-gp5p-5248 MEDIUM PoC AVAILABLE CISA: TRACK*Any authenticated user of a Gradio deployment (versions 5.0.0–5.4.x) can read arbitrary files from the server filesystem via the File or UploadButton components. In AI/ML environments this typically means API keys, .env files, and model configs are at risk. Upgrade to 5.5.0 immediately — no workarounds exist.
Risk Assessment
CVSS 6.5 Medium understates practical risk in AI/ML environments. Gradio servers routinely run with broad filesystem access alongside sensitive assets: Hugging Face tokens, OpenAI API keys, cloud credentials, and training data. The attack requires only low privilege (any authenticated user) and zero user interaction, making it trivially exploitable by any application user. EPSS of 0.26% reflects limited observed exploitation, but the minimal exploit barrier warrants prompt remediation, especially for public-facing or multi-tenant deployments.
Affected Systems
Severity & Risk
Attack Surface
Recommended Action
1 step-
1) Upgrade to Gradio 5.5.0 — the only available fix, no workarounds exist per the advisory. 2) If upgrade is delayed, restrict network access via firewall rules to trusted IP ranges only. 3) Treat any Gradio instance with untrusted user access as potentially compromised — audit access logs for anomalous file requests via upload endpoints. 4) Rotate all credentials (API keys, tokens, DB passwords) accessible on affected servers. 5) Inventory all internal Gradio deployments; shadow IT ML demos are a common blind spot.
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-51751?
Any authenticated user of a Gradio deployment (versions 5.0.0–5.4.x) can read arbitrary files from the server filesystem via the File or UploadButton components. In AI/ML environments this typically means API keys, .env files, and model configs are at risk. Upgrade to 5.5.0 immediately — no workarounds exist.
Is CVE-2024-51751 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2024-51751, increasing the risk of exploitation.
How to fix CVE-2024-51751?
1) Upgrade to Gradio 5.5.0 — the only available fix, no workarounds exist per the advisory. 2) If upgrade is delayed, restrict network access via firewall rules to trusted IP ranges only. 3) Treat any Gradio instance with untrusted user access as potentially compromised — audit access logs for anomalous file requests via upload endpoints. 4) Rotate all credentials (API keys, tokens, DB passwords) accessible on affected servers. 5) Inventory all internal Gradio deployments; shadow IT ML demos are a common blind spot.
What systems are affected by CVE-2024-51751?
This vulnerability affects the following AI/ML architecture patterns: ML demo environments, model serving, internal ML tooling, RAG pipelines.
What is the CVSS score for CVE-2024-51751?
CVE-2024-51751 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 0.27%.
Technical Details
NVD Description
Gradio is an open-source Python package designed to enable quick builds of a demo or web application. If File or UploadButton components are used as a part of Gradio application to preview file content, an attacker with access to the application might abuse these components to read arbitrary files from the application server. This issue has been addressed in release version 5.5.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Exploitation Scenario
An adversary gains low-privilege access to a shared Gradio demo (via a public URL or internal trial account). Using the File or UploadButton component, they issue requests with path traversal sequences — e.g., `../../.env` or `../../../root/.ssh/id_rsa` — to read files outside the intended directory. In a typical ML environment this yields Hugging Face tokens, OpenAI or Anthropic API keys, or database credentials. The attacker then pivots: accessing model repositories on HuggingFace, cloud training infrastructure, or upstream data stores — turning a Medium-severity UI bug into a full credential compromise.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/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