CVE-2025-48889: Gradio unauthorized file copy via path manipulation in flagging feature

CVE-2025-48889 · Severity: medium · CVSS 5.3 · Published 2025-05-29

Gradio, a popular library for building machine learning web interfaces, contains a vulnerability in its data flagging feature. An unauthenticated attacker can remotely trigger the server to copy any file it has access to into a public directory. This can be used to exhaust server disk space, potentially leading to a complete service outage.

Technologies: gradio (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2025-48889 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-48889 being exploited in the wild.
How severe is CVE-2025-48889?
Medium severity, with a CVSS score of 5.3, published 29 May 2025.
Which products and versions are affected?
gradio (PyPI) < 5.31.0, ECOSYSTEM:introduced=0,fixed=5.31.0, ECOSYSTEM:introduced=5.25.2,fixed=5.31.0.
Is there a fix for CVE-2025-48889?
Yes. gradio (PyPI): upgrade to 5.31.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-48889 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-48889?
Check whether you run gradio (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • gradio (PyPI): upgrade to 5.31.0 or later
    pip install "gradio>=5.31.0"

Technical details

An arbitrary file copy vulnerability exists in Gradio's flagging component due to insufficient validation of the 'path' parameter within the FileData object. By sending a specially crafted JSON payload to the '/gradio_api/run/predict' endpoint, an unauthenticated attacker can control the source path passed to the 'shutil.copy' operation in the 'FileData._copy_to_dir()' method. While the attacker cannot directly read the contents of the copied files through this specific bug, they can target large system files (e.g., /dev/urandom) to fill the server's disk space, causing a Denial of Service (DoS). The vulnerability is addressed in Gradio version 5.31.0.

Affected products

  • gradio-app gradio < 5.31.0

Identifiers

  • CVE-2025-48889
  • GHSA-8jw3-6x8j-v96g
  • PYSEC-2025-119

Timeline

  • 2025-05-29: disclosed
  • 2025-05-29: advisory
  • 2025-05-29: patched: Fixed in version 5.31.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.