NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Gradio

CVE-2024-47166: Gradio has a one-level read path traversal in `/custom_component`

mediumCVSS 4.0 6.9 · 3.1 5.3GHSA-37qc-qgx6-9xjv

Gradio before 4.44.0 has a one-level read path traversal in its /custom_component endpoint. An unauthenticated caller can change the file path in the request to read and leak the source code of custom Gradio components. Only developers who host custom components on public servers are affected. Upgrade to gradio 4.44.0.

Published Oct 10, 2024 · Updated Jan 21, 2025 · Analysis Nov 1, 2026

What an attacker can do

The /custom_component endpoint serves files that belong to a custom Gradio component. The path in the request is not confined, so a caller can step up one directory level. That reaches files next to the component and exposes its source.

The traversal reaches a single level only. The advisory still says it can expose proprietary or sensitive code that developers meant to keep private. The CVSS vectors show network access, no privileges and no user interaction, with low confidentiality impact only. No write or availability effect is described.

The flaw matters to teams that built custom Gradio components and run them on publicly reachable servers. The attacker gets source code. That may include hard-coded endpoints, logic or keys that the component carries. It does not give code execution. Stock Gradio apps with no custom components have nothing of this kind to leak through this endpoint.

Who is affected

gradio on pip, all versions below 4.44.0, for servers that host custom components and are reachable by untrusted users. Check the version:

pip show gradio

gradio

Ecosystem
PyPI
Affected
< 4.44.0
Fixed in
4.44.0
Check
pip show gradio

How to fix it

Upgrade to gradio 4.44 or later; the package data gives 4.44.0 as the patched version:

pip install --upgrade "gradio>=4.44"

The advisory's workaround for those who cannot upgrade: sanitize the file paths, and make sure custom components are not stored in publicly accessible directories.

How to tell if you were hit

Search web server logs for requests to /custom_component whose path contains '..' or encoded variants. Compare the files requested with your component directories. Check whether secrets or private logic live in component source on public servers, and rotate any that do if you see probing.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

What kind of vulnerability is it? Who is impacted?

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.

Patches

Yes, please upgrade to gradio>=4.44 to address this issue.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, developers can sanitize the file paths and ensure that components are not stored in publicly accessible directories.

Credited to ahpaleus, Vasco-jofra.

Questions

What can an attacker read through CVE-2024-47166?

Source code of custom Gradio components, by changing the file path sent to /custom_component. The traversal goes up only one directory level.

Does a plain Gradio app without custom components have this problem?

The advisory says it affects users who developed custom components and host them on publicly accessible servers. Upgrade anyway if you run a version below 4.44.

Which version fixes it?

gradio 4.44.0. Without upgrading, sanitize paths and keep components out of public directories.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Gradio vulnerabilities

All Gradio entries