CVE-2024-47167
JSON

6.9medium

SSRF in the path parameter of /queue/join in Gradio

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.48% (higher than 42% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-576c-3j53-r9jjPYSEC-2024-215

Description

Gradio is an open-source Python package designed for quick prototyping. This vulnerability relates to **Server-Side Request Forgery (SSRF)** in the `/queue/join` endpoint. Gradio’s `async_save_url_to_cache` function allows attackers to force the Gradio server to send HTTP requests to user-controlled URLs. This could enable attackers to target internal servers or services within a local network and possibly exfiltrate data or cause unwanted internal requests. Additionally, the content from these URLs is stored locally, making it easier for attackers to upload potentially malicious files to the server. This impacts users deploying Gradio servers that use components like the Video component which involve URL fetching. Users are advised to upgrade to `gradio>=5` to address this issue. As a workaround, users can disable or heavily restrict URL-based inputs in their Gradio applications to trusted domains only. Additionally, implementing stricter URL validation (such as allowinglist-based validation) and ensuring that local or internal network addresses cannot be requested via the `/queue/join` endpoint can help mitigate the risk of SSRF attacks.

Affected

Product or packageVersionsReported by
gradio-app gradio< 5.0CVE List
gradio_project gradiobefore 5.0, before 5.0.0CVE List, NVD
gradio (PyPI)before 5.0.0GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
GitHub7.2medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-918

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Gradio is an open-source Python package designed for quick prototyping. This vulnerability relates to **Server-Side Request Forgery (SSRF)** in the `/queue/join` endpoint. Gradio’s `async_save_url_to_cache` function allows attackers to force the Gradio server to send HTTP requests to user-controlled URLs. This could enable attackers to target internal servers or services within a local network and possibly exfiltrate data or cause unwanted internal requests. Additionally, the content from these URLs is stored locally, making it easier for attackers to upload potentially malicious files to the server. This impacts users deploying Gradio servers that use components like the Video component which involve URL fetching. Users are advised to upgrade to `gradio>=5` to address this issue. As a workaround, users can disable or heavily restrict URL-based inputs in their Gradio applications to trusted domains only. Additionally, implementing stricter URL validation (such as allowinglist-based validation) and ensuring that local or internal network addresses cannot be requested via the `/queue/join` endpoint can help mitigate the risk of SSRF attacks.

GitHub Advisory Database
Impact

What kind of vulnerability is it? Who is impacted?

This vulnerability relates to Server-Side Request Forgery (SSRF) in the /queue/join endpoint. Gradio’s async_save_url_to_cache function allows attackers to force the Gradio server to send HTTP requests to user-controlled URLs. This could enable attackers to target internal servers or services within a local network and possibly exfiltrate data or cause unwanted internal requests. Additionally, the content from these URLs is stored locally, making it easier for attackers to upload potentially malicious files to the server. This impacts users deploying Gradio servers that use components like the Video component which involve URL fetching.

Patches

Yes, please upgrade to gradio>=5 to address this issue.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

As a workaround, users can disable or heavily restrict URL-based inputs in their Gradio applications to trusted domains only. Additionally, implementing stricter URL validation (such as allowinglist-based validation) and ensuring that local or internal network addresses cannot be requested via the /queue/join endpoint can help mitigate the risk of SSRF attacks.

NVD (es)

Gradio es un paquete Python de código abierto diseñado para la creación rápida de prototipos. Esta vulnerabilidad está relacionada con Server-Side Request Forgery (SSRF) en el endpoint `/queue/join`. La función `async_save_url_to_cache` de Gradio permite a los atacantes obligar al servidor Gradio a enviar solicitudes HTTP a URL controladas por el usuario. Esto podría permitir a los atacantes apuntar a servidores o servicios internos dentro de una red local y posiblemente exfiltrar datos o causar solicitudes internas no deseadas. Además, el contenido de estas URL se almacena localmente, lo que facilita que los atacantes carguen archivos potencialmente maliciosos al servidor. Esto afecta a los usuarios que implementan servidores Gradio que usan componentes como el componente Video que implica la obtención de URL. Se recomienda a los usuarios que actualicen a `gradio&gt;=5` para solucionar este problema. Como workaround, los usuarios pueden deshabilitar o restringir en gran medida las entradas basadas en URL en sus aplicaciones Gradio solo a dominios confiables. Además, implementar una validación de URL más estricta (como una validación basada en listas de permisos) y garantizar que no se puedan solicitar direcciones de red locales o internas a través del endpoint `/queue/join` puede ayudar a mitigar el riesgo de ataques SSRF.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-47167 changed 2024-10-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-576c-3j53-r9jj changed 2025-01-21CC-BY-4.0
NVDCVE-2024-47167 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2024-215 changed 2025-01-19CC-BY-4.0