CVE-2024-51751: Gradio: path traversal exposes arbitrary server files
GHSA-rhm9-gp5p-5248MEDIUMPoC AVAILABLECISA: 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.
What is the risk?
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.
What systems are affected?
How severe is it?
What is the attack surface?
What should I do?
1 step1) 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 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-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.68%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0025Exfiltration via Cyber MeansAML.T0037Data from Local SystemAML.T0049Exploit Public-Facing ApplicationCompliance Controls Affected
What are the technical details?
Original Advisory
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)
CWE-200Exposure of Sensitive Information to an Unauthorized ActorPrimaryCWE-22Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')PrimaryCWE-22Improper Limitation of a Pathname to a Restricted DirectoryCWE-200 — Exposure of Sensitive Information to an Unauthorized Actor: The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
- [Architecture and Design] Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:NReferences
Timeline
Related Vulnerabilities
CVE-2024-392369.8Gradio: code injection via component metadata (CVSS 9.8)
Same package: gradioCVE-2024-471679.8Gradio: unauthenticated SSRF in /queue/join, internal pivot
Same package: gradioCVE-2023-258239.8Gradio: hardcoded SSH key leaks via share=True demos
Same package: gradioCVE-2024-09649.4Gradio: unauthenticated LFI exposes full server filesystem
Same package: gradioCVE-2024-42539.1Gradio: CI/CD command injection enables secrets exfiltration
Same package: gradio