CVE-2023-51449: Gradio: path traversal grants arbitrary file read
HIGH PoC AVAILABLE NUCLEI TEMPLATEAny Gradio app below version 4.11.0 with a public URL — Hugging Face Spaces or share=True demos — exposes the entire host filesystem to unauthenticated remote attackers. Upgrade to 4.11.0 immediately and rotate all secrets on affected hosts. Assume model weights, API keys, and credentials may already be exfiltrated.
What is the risk?
High risk in practice. CVSS 7.5 understates operational exposure: zero authentication, trivial exploit, and the ML demo use case means thousands of instances run publicly by design. Hugging Face Spaces deployments are especially exposed. Sensitive assets at risk include .env files with LLM API keys, cloud credentials, proprietary model weights, and training data. No active KEV listing but the exploit pattern is well-known and automatable.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Gradio | pip | — | No patch |
Do you use Gradio? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Immediate: Upgrade gradio to >= 4.11.0 across all environments.
-
Audit: Inventory all Gradio instances — flag any running with share=True or deployed to Hugging Face Spaces on vulnerable versions.
-
Rotate: All secrets (API keys, cloud credentials, tokens) on hosts running vulnerable versions.
-
Detection: Grep web server / application logs for /file route requests containing traversal sequences: ../, %2e%2e, %252e%252e, encoded variants.
-
Harden: Place Gradio apps behind an authenticated reverse proxy in production; never expose share=True publicly for sensitive workloads.
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-2023-51449?
Any Gradio app below version 4.11.0 with a public URL — Hugging Face Spaces or share=True demos — exposes the entire host filesystem to unauthenticated remote attackers. Upgrade to 4.11.0 immediately and rotate all secrets on affected hosts. Assume model weights, API keys, and credentials may already be exfiltrated.
Is CVE-2023-51449 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2023-51449, increasing the risk of exploitation.
How to fix CVE-2023-51449?
1. Immediate: Upgrade gradio to >= 4.11.0 across all environments. 2. Audit: Inventory all Gradio instances — flag any running with share=True or deployed to Hugging Face Spaces on vulnerable versions. 3. Rotate: All secrets (API keys, cloud credentials, tokens) on hosts running vulnerable versions. 4. Detection: Grep web server / application logs for /file route requests containing traversal sequences: ../, %2e%2e, %252e%252e, encoded variants. 5. Harden: Place Gradio apps behind an authenticated reverse proxy in production; never expose share=True publicly for sensitive workloads.
What systems are affected by CVE-2023-51449?
This vulnerability affects the following AI/ML architecture patterns: ML demo platforms, model serving, inference endpoints, training pipelines.
What is the CVSS score for CVE-2023-51449?
CVE-2023-51449 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 2.28%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0025 Exfiltration via Cyber Means AML.T0035 AI Artifact Collection AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitary Python function. Versions of `gradio` prior to 4.11.0 contained a vulnerability in the `/file` route which made them susceptible to file traversal attacks in which an attacker could access arbitrary files on a machine running a Gradio app with a public URL (e.g. if the demo was created with `share=True`, or on Hugging Face Spaces) if they knew the path of files to look for. This issue has been patched in version 4.11.0.
Exploitation Scenario
Attacker mass-scans Hugging Face Spaces and public Gradio instances for version disclosure via response headers or HTML metadata. Against a vulnerable target, they craft GET requests to /file=../../.env or /file=../../root/.aws/credentials — no authentication required, low complexity. Automated scripts enumerate common sensitive paths in seconds. Exfiltrated API keys fund further attacks (LLM abuse, cloud resource theft). Attack is silent, leaves minimal forensic trace beyond HTTP access logs that operators rarely monitor.
Weaknesses (CWE)
CWE-22 — Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'): The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
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
- github.com/gradio-app/gradio/commit/1b9d4234d6c25ef250d882c7b90e1f4039ed2d76 Patch
- github.com/gradio-app/gradio/commit/7ba8c5da45b004edd12c0460be9222f5b5f5f055 Patch
- github.com/gradio-app/gradio/security/advisories/GHSA-6qm2-wpxq-7qh2 3rd Party
- github.com/J1ezds/Vulnerability-Wiki-page Exploit
- github.com/Threekiii/Awesome-POC Exploit
- github.com/g1san/Agents-for-Vulnerable-Dockers-and-related-Benchmarks Exploit
- github.com/google/tsunami-security-scanner-plugins Exploit
- github.com/nvn1729/advisories Exploit
Timeline
Scanner Template Available
A Nuclei vulnerability scanner template exists for this CVE. You can scan your infrastructure for this vulnerability immediately.
View template on GitHubnuclei -t http/cves/2023/CVE-2023-51449.yaml -u https://target.example.com Related Vulnerabilities
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-39236 9.8 Gradio: code injection via component metadata (CVSS 9.8)
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