VYPR
Moderate severityNVD Advisory· Published Nov 6, 2024· Updated Nov 6, 2024

Arbitrary file read with File and UploadButton components in Gradio

CVE-2024-51751

Description

Gradio is an open-source Python package designed to enable quick builds of a demo or web application. If File or UploadButton components are used as a part of Gradio application to preview file content, an attacker with access to the application might abuse these components to read arbitrary files from the application server. This issue has been addressed in release version 5.5.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Unauthenticated file disclosure in Gradio via File/UploadButton components when the `meta` object is omitted from API requests.

Vulnerability

CVE-2024-51751 is a path traversal-like vulnerability in Gradio, the open-source Python framework for building machine learning demos and web applications [1][2]. When an application uses File or UploadButton components to preview uploaded file content, an attacker can read arbitrary files from the server's filesystem. The root cause is insufficient validation in the processing_utils.async_move_files_to_cache function. Gradio relies on the client_utils.is_file_obj_with_meta filter to traverse and sanitize incoming file paths, but this filter only operates on objects that include a "meta" key with {"_type": "gradio.FileData"} [3].

Exploitation

An attacker with access to a Gradio application that exposes File or UploadButton components can craft a direct API request to the /gradio_api/run/predict endpoint. By sending a JSON payload containing a FileData object that specifies the path of a sensitive file on the server (e.g., /etc/passwd) and deliberately omitting the "meta" field, the is_file_obj_with_meta filter returns False. This causes Gradio to skip the sanitization step and directly process the attacker-supplied path, reading and returning its contents in the response [3]. No authentication is required beyond network access to the application.

Impact

Successful exploitation allows an attacker to read arbitrary files from the application server, including sensitive configuration files, source code, or credentials. The vulnerability does not require a valid file upload from a user session; a single crafted curl request suffices. The advisory states that no workarounds exist beyond upgrading [2].

Mitigation

The fix is included in Gradio version 5.5.0 [2][3]. All users running an earlier version who use File or UploadButton components should upgrade immediately. Since there are no known workarounds, updating is the only remediation.

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
gradioPyPI
>= 5.0.0, < 5.5.05.5.0

Affected products

2
  • ghsa-coords
    Range: >= 5.0.0, < 5.5.0
  • gradio-app/gradiov5
    Range: >= 5.0.0, < 5.5.0

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.