CVE-2021-43831: Files on the host computer can be accessed from the Gradio interface
Impact This is a vulnerability that affects anyone who creates and publicly shares Gradio interfaces using gradio =2.5.0.
Published Jan 21, 2022 · Updated Nov 18, 2024
Affected packages
gradio
- Ecosystem
- PyPI
- Affected
- < 2.5.0
- Fixed in
- 2.5.0
- Check
pip show gradio
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
- 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 - We enabled a notification that is printed to anyone using an older version of gradio telling them to upgrade (see screenshot below)
- We expanded our test suite to test for this vulnerability ensuring that our patch does not get reverted in future releases of
gradio
image
Patches
The problem has been patched in gradio>=2.5.0.
Credited to haby0.
References
- https://github.com/gradio-app/gradio/security/advisories/GHSA-rhq2-3vr9-6mcr
- https://nvd.nist.gov/vuln/detail/CVE-2021-43831
- https://github.com/gradio-app/gradio/commit/41bd3645bdb616e1248b2167ca83636a2653f781
- https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2021-873.yaml
- https://github.com/advisories/GHSA-rhq2-3vr9-6mcr
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. No analysis has been written for this entry yet. 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
