Gradio has a one-level read path traversal in `/custom_component`
Medium5.3CVE-2024-47166 · Published Oct 10, 2024 · updated Jan 21, 2025
### 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.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| gradio PyPI | < 4.44.0 | 4.44.0 |
Details and references
- CVSS 3.1
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-22
- Also known as
- CVE-2024-47166, PYSEC-2024-197
More Gradio advisories
All Gradio| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Oct 102024 | Gradio's dropdown component pre-process step does not limit the values to those in the dropdown list | Low5.3 | 5.0.0 |
| Oct 102024 | Gradio has an XSS on every Gradio server via upload of HTML files, JS files, or SVG files | Medium5.4 | 5.0.0 |
| Oct 102024 | Gradio uses insecure communication between the FRP client and server | High8.1 | 5.0.0 |
| Oct 102024 | Gradio has a race condition in update_root_in_config may redirect user traffic | High7.0 | 5.0.0 |
| Oct 102024 | Gradio performs a non-constant-time comparison when comparing hashes | Medium3.7 | 4.44.0 |
| Oct 102024 | Gradio has several components with post-process steps allow arbitrary file leaks | Medium5.3 | 5.0.0 |