CVE-2024-1728: Gradio allows users to access arbitrary files
Gradio before 4.19.2 lets a user of a publicly reachable Gradio app read files from the host by tampering with the requests the app sends to its server. The fix, in 4.19.2, makes components refuse local paths outside the upload folder. Upgrade to gradio 4.19.2 or later.
Published Sep 25, 2024 · Updated Oct 27, 2026 · Analysis Nov 1, 2026
What an attacker can do
Gradio components accept file inputs as path references in the request body. Before the fix, move_files_to_cache() in gradio/processing_utils.py copied whatever local path it received into the cache without checking where the file lived. A user who intercepts and edits the network request that the app's front end sends can replace the uploaded file's path with a path on the server, such as a config or key file, and get it back through the app. This is path traversal (CWE-22).
The attacker needs only the app's public link, for example a Hugging Face Space or a shared tunnel. No account and no user interaction are required. The CVSS vector rates attack complexity high because the attacker must craft the modified request. It rates confidentiality, integrity and availability all high.
What an attacker reaches depends on what the Gradio process can read: API keys in environment files, model files, source code, SSH keys. The advisory says the maintainers know of no exploitation. EPSS is very high, in the 99.7th percentile.
Who is affected
The pip package gradio, all versions below 4.19.2. Apps exposed through a public link or hosted publicly are the concern. Check the version:
pip show gradiogradio
- Ecosystem
- PyPI
- Affected
- < 4.19.2
- Fixed in
- 4.19.2
- Check
pip show gradio
How to fix it
Upgrade to gradio 4.19.2 or later.
pip install --upgrade "gradio>=4.19.2"The fix is commit 16fbe9cd0cffa9f2a824a0165beb43446114eec7. It adds a get_upload_folder() helper, which returns GRADIO_TEMP_DIR if you set it and the gradio folder in the system temp directory otherwise. Event-listener and API calls now raise a ValueError for files outside that folder. Direct Python calls to a Blocks function skip the check. The advisory names no workaround.
How to tell if you were hit
Search app and proxy logs for the error text is not in the upload folder and cannot be accessed, which patched versions raise on such attempts. On older versions, look at request bodies sent to Gradio API routes for file paths that point outside the temp upload folder, for example /etc/passwd or home directories. Review the app for unexpected downloads of system files.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
This vulnerability allows users of Gradio applications that have a public link (such as on Hugging Face Spaces) to access files on the machine hosting the Gradio application. This involves intercepting and modifying the network requests made by the Gradio app to the server.
Patches
Yes, the problem has been patched in Gradio version 4.19.2 or higher. We have no knowledge of this exploit being used against users of Gradio applications, but we encourage all users to upgrade to Gradio 4.19.2 or higher.
Fixed in: https://github.com/gradio-app/gradio/commit/16fbe9cd0cffa9f2a824a0165beb43446114eec7 CVE: https://nvd.nist.gov/vuln/detail/CVE-2024-1728
Credited to PinkDraconian.
Questions
- Is CVE-2024-1728 exploited in the wild?
The advisory says the maintainers have no knowledge of it being used against Gradio apps. It is not in CISA's KEV catalog.
- Does the app need a public link?
The advisory describes apps with a public link, such as Hugging Face Spaces. Any app whose server an attacker can reach and send requests to is in the same position.
- Which version fixes it?
gradio 4.19.2. Versions below it are listed as vulnerable.
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
