CVE-2023-51449 Make the `/file` secure against file traversal attacks
Attackers can read arbitrary files on servers running Gradio apps with public URLs via path traversal in the /file route.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-51449?
CVE-2023-51449 is a medium-severity path traversal vulnerability in Gradio Project Gradio, published on 22 Dec 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitary Python function. Versions of `gradio` prior to 4.11.0 contained a vulnerability in the `/file` route which made them susceptible to file traversal attacks in which an attacker could access arbitrary files on a machine running a Gradio app with a public URL (e.g. if the demo was created with `share=True`, or on Hugging Face Spaces) if they knew the path of files to look for. This issue has been patched in version 4.11.0.
Weakness: CWE-22
Which versions are affected by CVE-2023-51449?
3 open source packages ship an affected version, including gradio. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
gradio PyPI | All versions | 4.11.0 |
gradio PyPI | All versions | 4.11.0 |
gradio PyPI | All versions | 4.11.0 |
Products include Gradio Project Gradio.
How do I fix CVE-2023-51449?
Upgrade gradio to 4.11.0 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2023-51449 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-51449 exists.
Public exploit code: 1 Nuclei template.
Other vulnerabilities in Gradio Project Gradio
- CVE-2024-39236 Withdrawn Advisory: Gradio was discovered to contain a code injection vulnerability via the component /gradio/component_meta.py
- CVE-2023-6572 Command Injection in gradio-app/gradio
- CVE-2022-24770 Improper Neutralization of Formula Elements in a CSV File in Gradio Flagging
- CVE-2026-49119 Gradio < 6.16.0 Path Traversal via FileExplorer.preprocess()
- CVE-2025-23042 Gradio Blocked Path ACL Bypass Vulnerability
Sources
Also known as GHSA-6qm2-wpxq-7qh2, PYSEC-2023-249.