CVE-2024-47166: Gradio: path traversal leaks custom component source

GHSA-37qc-qgx6-9xjv MEDIUM
Published October 10, 2024
CISO Take

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?

Package Ecosystem Vulnerable Range Patched
Gradio pip No patch
43.0K OpenSSF 5.6 685 dependents Pushed 4d ago 26% patched ~110d to patch Full package profile →
Gradio pip < 4.44.0 4.44.0
43.0K OpenSSF 5.6 685 dependents Pushed 4d ago 26% patched ~110d to patch Full package profile →

How severe is it?

CVSS 3.1
5.3 / 10
EPSS
0.4%
chance of exploitation in 30 days
Higher than 34% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C Low
I None
A None

What should I do?

6 steps
  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 does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact partial

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:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2 - AI system security
NIST AI RMF
MANAGE 2.2 - Risk prioritization and treatment
OWASP LLM Top 10
LLM06 - Sensitive Information Disclosure

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

ML UI/demo applicationsModel servingPrototype deploymentsInternal AI tooling

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

EU AI Act: Article 15
ISO 42001: A.6.2
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM06

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'): 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

Timeline

Published
October 10, 2024
Last Modified
January 21, 2025
First Seen
October 10, 2024

Related Vulnerabilities