Browse / AI Framework and Platform Flaws / CVE-2021-43831
Files on the host computer can be accessed from the Gradio interface
- Class
- AI Framework and Platform Flaws (filed by a model that read the advisory)
- Technique
- Path traversal and file access
- Affected
- gradio (PyPI)
- CVSS
- CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
- EPSS
- 3.8% chance of exploitation in 30 days
How it works, in short
Older Gradio versions served static files without path checks, so anyone with a public link could read host files by path. (Our summary, written by a model. The source text is below.)
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.
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/gradio-app/gradio
- https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2021-873.yaml
Source: GitHub Advisory Database, used under CC BY 4.0.