Miggo Logo

CVE-2025-48889: Gradio Allows Unauthorized File Copy via Path Manipulation

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.23354%
Published
5/29/2025
Updated
5/30/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
gradiopip< 5.31.05.31.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability (GHSA-8jw3-6x8j-v96g) allows arbitrary file copying in Gradio's flagging feature due to insufficient path validation. The user-controlled path parameter, sent via a JSON payload to the /gradio_api/run/predict endpoint, is used by the gradio.components.file.FileData._copy_to_dir method in a shutil.copy operation without proper sanitization. This is the direct sink of the vulnerability.

The gradio.blocks.Blocks.preprocess_data function is a crucial part of the execution flow. It handles the data from API requests. In vulnerable versions, this function did not adequately ensure that the user-supplied file path was validated before being processed by the FileData component. The fix, identified in commit 40997002090b0ad7cd1037872523dcdd9bf45bc3, was applied to Blocks.preprocess_data. This patch ensures that data validation (specifically data_model.model_validate) is performed for components like FileData, thus preventing the malicious path from reaching FileData._copy_to_dir unvalidated.

Therefore, gradio.components.file.FileData._copy_to_dir is the function containing the vulnerable shutil.copy operation, and gradio.blocks.Blocks.preprocess_data is the higher-level function that, prior to the patch, failed to prevent unvalidated paths from being processed, making it a key part of the vulnerable pathway. Both functions would likely appear in a runtime profile during the exploitation of this vulnerability.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n *r*itr*ry *il* *opy vuln*r**ility in *r**io's *l***in* ***tur* *llows un*ut**nti**t** *tt**k*rs to *opy *ny r*****l* *il* *rom t** s*rv*r's *il*syst*m. W*il* *tt**k*rs **n't r*** t**s* *opi** *il*s, t**y **n **us* *oS *y *opyin* l*r** *il*s (lik*

Reasoning

T** vuln*r**ility (**S*-*jw*-*x*j-v***) *llows *r*itr*ry *il* *opyin* in *r**io's *l***in* ***tur* *u* to insu**i*i*nt p*t* v*li**tion. T** us*r-*ontroll** `p*t*` p*r*m*t*r, s*nt vi* * JSON p*ylo** to t** `/*r**io_*pi/run/pr**i*t` *n*point, is us** *