Executive brief
Gradio is a Python library for building machine learning web interfaces with drag-and-drop components. The Dropdown component has a validation flaw where it does not properly restrict user inputs to the predefined list of allowed values, even when configured to reject custom values. An attacker can send arbitrary values by crafting direct requests, bypassing the developer's intended input constraints. While the issue alone has limited impact, it could be chained with other vulnerabilities to cause more serious harm.
Technical details
The vulnerability is a data validation issue in Gradio's Dropdown component pre-processing step. Even when the allow_custom_value parameter is set to False, the component fails to enforce this restriction during request processing, allowing attackers to send custom requests with arbitrary values. The flaw affects all versions prior to 5.0. No authentication is required; the attack requires only network access to the Gradio application. While the bypass itself does not directly compromise confidentiality, it can facilitate secondary attacks such as unauthorized file access when combined with other vulnerabilities. The issue is patched in Gradio version 5.0 and later.
Affected products
- Gradio Gradio all versions before 5.0
Timeline
- 2024-10-10: disclosed: Security advisory published
- 2024-10-10: patched: Patched in version 5.0