Files on the host computer can be accessed from the Gradio interface
Published 21 Jan 2022 · Updated 8 Jul 2026
Is your project on an affected gradio?
Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <2.5.0
- Fixed in
- 2.5.0
pip install 'gradio>=2.5.0'Details
Impact
This is a vulnerability that affects anyone who creates and publicly shares Gradio interfaces using gradio<2.4.8. Because of the way that static files were being served, someone who generated a public Gradio link and shared it with others would potentially be exposing the files on the computer that generated the link, while the link was active. An attacker would be able to view the contents of a file on the computer if they knew the exact relative filepath. We do not have any evidence that this was ever exploited, but we treated the issue seriously and immediately took steps to mitigate it (see below)
Response
1. We worked with @haby0 to immediately patch the issue and released a new version, gradio 2.5.0, within 24 hours of the issue being brought to our attention
2. We enabled a notification that is printed to anyone using an older version of gradio telling them to upgrade (see screenshot below)
3. We expanded our test suite to test for this vulnerability ensuring that our patch does not get reverted in future releases of gradio
Patches
The problem has been patched in gradio>=2.5.0.
Is GHSA-rhq2-3vr9-6mcr in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected gradio, and gives you the command that fixes it.
More advisories for gradio
- HighCVE-2026-49119 Gradio FileExplorer preprocess path traversal allows files outside root_dir to reach callbacks · 1 Jul 2026
- LowCVE-2026-10783Gradio: Audio cache key ignores metadata when saving numpy audio outputs · 4 Jun 2026
- HighCVE-2026-48545Gradio contains a cookie injection vulnerability · 27 May 2026
- HighCVE-2026-28416Gradio has SSRF via Malicious `proxy_url` Injection in `gr.load()` Config Processing · 1 Mar 2026
- MediumCVE-2026-28415Gradio has an Open Redirect in its OAuth Flow · 1 Mar 2026
- HighCVE-2026-28414Gradio is Vulnerable to Absolute Path Traversal on Windows with Python 3.13+ · 1 Mar 2026
References
- Linkgithub.com/gradio-app/gradio/security/advisories/GHSA-rhq2-3vr9-6mcr
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-43831
- Linkgithub.com/gradio-app/gradio/commit/41bd3645bdb616e1248b2167ca83636a2653f781
- Packagegithub.com/gradio-app/gradio
- Linkgithub.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2021-873.yaml
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.