Skip to content
LowVulnerability

GHSA-26jh-r8g2-6fpr: Gradio's dropdown component pre-process step does not limit the values to those in the dropdown list

Published
Record updated
View JSON
Affected
  • gradio < 5.0.0
Fixed in
5.0.0

Summary

Gradio's Dropdown component does not enforce its pre-process restriction to listed values, so setting allow_custom_value to False does not stop requests carrying arbitrary values. The source calls this a data validation issue that is not severe alone but can enable more serious problems when combined with other flaws, such as file downloads from the user's machine.

Mitigation

Upgrade to gradio>=5.0, which addresses the issue. Without upgrading, add manual validation in the prediction function that checks received values against the allowed dropdown values before processing them.