CVE-2021-43831
JSON

7.7high

Files on the host computer can be accessed from the Gradio interface

Severity
7.7high CVSS:3.1 by GitHub_M
Exploit likelihood
3.84% (higher than 90% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rhq2-3vr9-6mcrPYSEC-2021-873

Description

Gradio is an open source framework for building interactive machine learning models and demos. In versions prior to 2.5.0 there is a vulnerability that affects anyone who creates and publicly shares Gradio interfaces. File paths are not restricted and users who receive a Gradio link can access any files on the host computer if they know the file names or file paths. This is limited only by the host operating system. Paths are opened in read only mode. The problem has been patched in gradio 2.5.0.

Affected

Product or packageVersionsReported by
gradio-app gradio< 2.5.0CVE List
gradio (PyPI)before 2.5.0, before 41bd3645bdb616e1248b2167ca83636a2653f781GitHub Advisory Database, PyPA Advisory Database
gradio_project gradiobefore 2.5.0NVD

All scores

GitHub_M7.7high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
GitHub8.3critical CVSS:3.1CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N
NVD7.7high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
NVD3.5low CVSS:2.0AV:N/AC:M/Au:S/C:P/I:N/A:N

Classification

What each source says

CVE List

Gradio is an open source framework for building interactive machine learning models and demos. In versions prior to 2.5.0 there is a vulnerability that affects anyone who creates and publicly shares Gradio interfaces. File paths are not restricted and users who receive a Gradio link can access any files on the host computer if they know the file names or file paths. This is limited only by the host operating system. Paths are opened in read only mode. The problem has been patched in gradio 2.5.0.

GitHub Advisory Database
Impact

This is a vulnerability that affects anyone who creates and publicly shares Gradio interfaces using gradio<2.4.8. Because of the way that static files were being served, someone who generated a public Gradio link and shared it with others would potentially be exposing the files on the computer that generated the link, while the link was active. An attacker would be able to view the contents of a file on the computer if they knew the exact relative filepath. We do not have any evidence that this was ever exploited, but we treated the issue seriously and immediately took steps to mitigate it (see below)

Response
  1. We worked with @haby0 to immediately patch the issue and released a new version, gradio 2.5.0, within 24 hours of the issue being brought to our attention
  2. We enabled a notification that is printed to anyone using an older version of gradio telling them to upgrade (see screenshot below)
  3. We expanded our test suite to test for this vulnerability ensuring that our patch does not get reverted in future releases of gradio

image

Patches

The problem has been patched in gradio>=2.5.0.

NVD (es)

Gradio es un marco de trabajo de código abierto para la construcción de modelos y demostraciones interactivas de aprendizaje automático. En las versiones anteriores a 2.5.0, se presenta una vulnerabilidad que afecta a cualquiera que cree y comparta públicamente interfaces de Gradio. Las rutas de los archivos no están restringidas y los usuarios que reciben un enlace de Gradio pueden acceder a cualquier archivo del ordenador anfitrión si conocen los nombres o las rutas de los archivos. Esto está limitado únicamente por el sistema operativo del host. Las rutas son abiertas en modo de sólo lectura. El problema ha sido parcheado en gradio versión 2.5.0

References

Sources

SourceRecordLicence
CVE ListCVE-2021-43831 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-rhq2-3vr9-6mcr changed 2026-07-08CC-BY-4.0
NVDCVE-2021-43831 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-873 changed 2023-11-08CC-BY-4.0