Junglewise Threat Intelligence

CVE-2024-51751: Gradio arbitrary file read in File and UploadButton components

CVE-2024-51751 · Severity: medium · CVSS 3.1 · Published 2024-11-06

Technologies: gradio (PyPI). Vendors: PyPI.

Executive brief

Gradio, a popular library for building machine learning web interfaces, contains a vulnerability in its file handling components. An attacker can bypass security checks to read sensitive files from the server hosting the application. This could lead to the exposure of system configuration files, credentials, or private data, potentially compromising the entire server.

Technical details

A path traversal vulnerability exists in Gradio's File and UploadButton components due to insufficient validation in the path sanitization logic. The library uses `client_utils.is_file_obj_with_meta` to identify and sanitize file paths; however, this function only triggers if a specific 'meta' key is present in the request. By omitting this key or providing an unexpected '_type', an attacker can bypass the `_move_to_cache` security check. This allows the attacker to provide an absolute file path (e.g., /etc/passwd) which is then processed and returned by the application. The vulnerability is patched in version 5.5.0.

Affected products

  • gradio-app gradio >= 5.0.0, < 5.5.0

Timeline

  • 2024-11-06: disclosed
  • 2024-11-06: advisory
  • 2024-11-06: patched: Fixed in version 5.5.0

References

Related threats