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.

Risk Assessment

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.

Affected Systems

Package Ecosystem Vulnerable Range Patched
gradio pip No patch
42.5K OpenSSF 5.6 674 dependents Pushed 8d ago 27% patched ~110d to patch Full package profile →
gradio pip < 4.44.0 4.44.0
42.5K OpenSSF 5.6 674 dependents Pushed 8d ago 27% patched ~110d to patch Full package profile →

Severity & Risk

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

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

Recommended Action

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.

CISA SSVC Assessment

Decision Track
Exploitation none
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

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.24%.

Technical Details

NVD Description

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.

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