Any organization hosting public-facing Gradio instances with custom components should patch to 4.44+ immediately — no authentication is required to exploit this. The attack is trivial (one-level directory traversal via crafted HTTP request) and could expose proprietary ML inference code, embedded secrets, or business logic in custom components. Low EPSS suggests limited active exploitation today, but the low friction means opportunistic scanning is realistic.
What is the risk?
Effective risk is medium-to-high for organizations using Gradio custom components on internet-facing servers, despite the CVSS 5.3 rating. The no-auth, network-accessible attack vector eliminates most barriers. Gradio is extensively used for AI/ML demos and internal tooling that often get inadvertently exposed publicly. The one-level traversal limit constrains impact but does not eliminate it — adjacent files to component directories (configs, init files, API keys hardcoded in source) are in scope. EPSS of 0.245% is low but the ease of exploitation warrants proactive patching.
What systems are affected?
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Patch immediately: upgrade to gradio>=4.44.0 (pip install --upgrade gradio).
-
If patching is blocked, sanitize file path inputs in custom component endpoint handlers and relocate component code outside publicly accessible directories.
-
Audit all production Gradio deployments — inventory which expose custom components and whether they are internet-accessible.
-
Review web server/application logs for requests to /custom_component containing ../ or %2e%2e patterns as indicators of prior exploitation.
-
Rotate any secrets (API keys, tokens) found in custom component source files as a precaution.
-
Apply network-level controls (WAF rule blocking path traversal patterns, IP allowlisting) as defense-in-depth.
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-47166?
Any organization hosting public-facing Gradio instances with custom components should patch to 4.44+ immediately — no authentication is required to exploit this. The attack is trivial (one-level directory traversal via crafted HTTP request) and could expose proprietary ML inference code, embedded secrets, or business logic in custom components. Low EPSS suggests limited active exploitation today, but the low friction means opportunistic scanning is realistic.
Is CVE-2024-47166 actively exploited?
No confirmed active exploitation of CVE-2024-47166 has been reported, but organizations should still patch proactively.
How to fix CVE-2024-47166?
1. Patch immediately: upgrade to gradio>=4.44.0 (pip install --upgrade gradio). 2. If patching is blocked, sanitize file path inputs in custom component endpoint handlers and relocate component code outside publicly accessible directories. 3. Audit all production Gradio deployments — inventory which expose custom components and whether they are internet-accessible. 4. Review web server/application logs for requests to /custom_component containing ../ or %2e%2e patterns as indicators of prior exploitation. 5. Rotate any secrets (API keys, tokens) found in custom component source files as a precaution. 6. Apply network-level controls (WAF rule blocking path traversal patterns, IP allowlisting) as defense-in-depth.
What systems are affected by CVE-2024-47166?
This vulnerability affects the following AI/ML architecture patterns: ML UI/demo applications, Model serving, Prototype deployments, Internal AI tooling.
What is the CVSS score for CVE-2024-47166?
CVE-2024-47166 has a CVSS v3.1 base score of 5.3 (MEDIUM). The EPSS exploitation probability is 0.42%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0025 Exfiltration via Cyber Means AML.T0035 AI Artifact Collection AML.T0048.004 AI Intellectual Property Theft AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
Gradio is an open-source Python package designed for quick prototyping. This vulnerability involves a **one-level read path traversal** in the `/custom_component` endpoint. Attackers can exploit this flaw to access and leak source code from custom Gradio components by manipulating the file path in the request. Although the traversal is limited to a single directory level, it could expose proprietary or sensitive code that developers intended to keep private. This impacts users who have developed custom Gradio components and are hosting them on publicly accessible servers. Users are advised to upgrade to `gradio>=4.44` to address this issue. As a workaround, developers can sanitize the file paths and ensure that components are not stored in publicly accessible directories.
Exploitation Scenario
An adversary performing reconnaissance on a target organization discovers a public-facing Gradio demo used for internal model access (common in AI/ML teams). They identify the /custom_component endpoint and craft HTTP GET requests with one-level path traversal (e.g., /custom_component/../config.py or /custom_component/../__init__.py). Without any authentication, they retrieve source code files adjacent to the component directory. The exfiltrated code reveals hardcoded API keys for downstream LLM services, internal model API endpoints, or proprietary data transformation logic — enabling further lateral movement or competitive intelligence theft.
Weaknesses (CWE)
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') 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:L/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-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-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