Executive brief
Gradio is an open-source library for building machine learning web applications. A local file inclusion vulnerability in the UploadButton component allows attackers to read arbitrary files from the server (such as SSH keys) by manipulating file paths in requests to the /queue/join endpoint. This could expose sensitive credentials and potentially enable further attacks.
Technical details
The vulnerability exists in Gradio's file upload handling, specifically in the UploadButton component. The /queue/join endpoint fails to properly validate user-supplied file paths, allowing directory traversal (CWE-22) attacks. An unauthenticated attacker can exploit this over the network to redirect file upload operations to arbitrary filesystem locations and read sensitive files. The vulnerability was patched in version 4.19.2, which adds validation to prevent components from working with non-uploaded files.
Affected products
- Gradio Gradio before 4.19.2
Timeline
- 2024-04-10: disclosed: Advisory published (duplicate of GHSA-m842-4qm8-7gpq)
- 2024-04-10: patched: Fixed in version 4.19.2