CVE-2024-47868: Gradio has several components with post-process steps allow arbitrary file leaks
Gradio before 5.0 does not validate data in the post-processing step of many components, including DownloadButton, Audio, Video, File, Chatbot, Code and Dataset. An attacker can send a crafted request with a file path such as /etc/passwd and get that file back. Upgrade to gradio 5.0.0.
Published Oct 10, 2024 · Updated Jan 21, 2025 · Analysis Nov 1, 2026
What an attacker can do
Many Gradio components turn the value a function returns into file data in a post-processing step. Some take a plain string, some a complex object or dictionary, and Code reads a file directly in preprocess. The advisory says the values are not checked, so a request that skips the intended input limits can name any file path on the server, and the component serves it.
The advisory groups the components. String to FileData: DownloadButton, Audio, ImageEditor, Video, Model3D, File, UploadButton. Complex data to FileData: Chatbot, MultimodalTextbox. Direct file read in preprocess: Code. Dictionary converted to FileData: ParamViewer, Dataset.
Two scenarios are given. A developer wires a Dropdown into a DownloadButton. The attacker bypasses the allowed choices, sends /etc/passwd and downloads it. Or an attacker crafts a payload for a ParamViewer component and leaks files the same way. The advisory also says the flaw is worse combined with another issue it calls TOB-GRADIO-15. CVSS shows network access, no privileges and low confidentiality impact. The attacker reads files the Gradio process can read, such as env files and keys.
Who is affected
gradio on pip, all versions below 5.0.0, in apps that use any of the components above to return or handle file data. Check the version:
pip show gradioThen look for DownloadButton, File, Audio, Video, Chatbot, Code, ParamViewer and Dataset in your app code.
gradio
- Ecosystem
- PyPI
- Affected
- < 5.0.0
- Fixed in
- 5.0.0
- Check
pip show gradio
How to fix it
Upgrade to gradio 5.0 or later:
pip install --upgrade "gradio>=5.0"The patched version in the package data is 5.0.0. The advisory lists no workaround other than upgrading. Until then, run the Gradio process with minimal file access and keep secrets out of files it can read.
How to tell if you were hit
Look in request logs for calls whose JSON data holds absolute paths, such as /etc/passwd, or other paths outside your app's directories, in fields that should hold app-defined values. Check which files your app served. Responses that return system files or env files point to exploitation.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
What kind of vulnerability is it? Who is impacted?
This is a data validation vulnerability affecting several Gradio components, which allows arbitrary file leaks through the post-processing step. Attackers can exploit these components by crafting requests that bypass expected input constraints. This issue could lead to sensitive files being exposed to unauthorized users, especially when combined with other vulnerabilities, such as issue TOB-GRADIO-15. The components most at risk are those that return or handle file data.
Vulnerable Components:
- String to FileData: DownloadButton, Audio, ImageEditor, Video, Model3D, File, UploadButton.
- Complex data to FileData: Chatbot, MultimodalTextbox.
- Direct file read in preprocess: Code.
- Dictionary converted to FileData: ParamViewer, Dataset.
Exploit Scenarios:
- A developer creates a Dropdown list that passes values to a DownloadButton. An attacker bypasses the allowed inputs, sends an arbitrary file path (like
/etc/passwd), and downloads sensitive files. - An attacker crafts a malicious payload in a ParamViewer component, leaking sensitive files from a server through the arbitrary file leak.
Patches
Yes, the issue has been resolved in gradio>5.0. Upgrading to the latest version will mitigate this vulnerability.
Credited to ahpaleus, Vasco-jofra.
Questions
- Which components does CVE-2024-47868 affect?
DownloadButton, Audio, ImageEditor, Video, Model3D, File, UploadButton, Chatbot, MultimodalTextbox, Code, ParamViewer and Dataset, as listed in the advisory.
- Can you give an exploit example?
A Dropdown feeds a DownloadButton. The attacker sends a request that skips the allowed values and names /etc/passwd as the file, then downloads it.
- Which version fixes it?
gradio 5.0.0. The advisory says upgrading mitigates the flaw.
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 entriesCVE-2026-49119
Gradio FileExplorer preprocess path traversal allows files outside root_dir to reach callbacks
high7.5Jul 1, 2026CVE-2026-10783
Gradio: Audio cache key ignores metadata when saving numpy audio outputs
low2.5Jun 4, 2026CVE-2026-48545
Gradio contains a cookie injection vulnerability
high6.8May 27, 2026CVE-2026-27167
Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
lowMar 1, 2026CVE-2026-28414
Gradio is Vulnerable to Absolute Path Traversal on Windows with Python 3.13+
high7.5Mar 1, 2026CVE-2026-28415
Gradio has an Open Redirect in its OAuth Flow
medium4.3Mar 1, 2026
