CVE-2024-47165
JSON

6.9medium

CORS origin validation accepts the null origin in Gradio

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.30% (higher than 24% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-89v2-pqfv-c5r9PYSEC-2024-214

Description

Gradio is an open-source Python package designed for quick prototyping. This vulnerability relates to **CORS origin validation accepting a null origin**. When a Gradio server is deployed locally, the `localhost_aliases` variable includes "null" as a valid origin. This allows attackers to make unauthorized requests from sandboxed iframes or other sources with a null origin, potentially leading to data theft, such as user authentication tokens or uploaded files. This impacts users running Gradio locally, especially those using basic authentication. Users are advised to upgrade to `gradio>=5.0` to address this issue. As a workaround, users can manually modify the `localhost_aliases` list in their local Gradio deployment to exclude "null" as a valid origin. By removing this value, the Gradio server will no longer accept requests from sandboxed iframes or sources with a null origin, mitigating the potential for exploitation.

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:N/VA:N/SC:N/SI:N/SA:N
GitHub5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
NVD5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
PyPA Advisory Database5.4medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Classification

CWE-285CWE-346

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 **CORS origin validation accepting a null origin**. When a Gradio server is deployed locally, the `localhost_aliases` variable includes "null" as a valid origin. This allows attackers to make unauthorized requests from sandboxed iframes or other sources with a null origin, potentially leading to data theft, such as user authentication tokens or uploaded files. This impacts users running Gradio locally, especially those using basic authentication. Users are advised to upgrade to `gradio>=5.0` to address this issue. As a workaround, users can manually modify the `localhost_aliases` list in their local Gradio deployment to exclude "null" as a valid origin. By removing this value, the Gradio server will no longer accept requests from sandboxed iframes or sources with a null origin, mitigating the potential for exploitation.

GitHub Advisory Database
Impact

What kind of vulnerability is it? Who is impacted?

This vulnerability relates to CORS origin validation accepting a null origin. When a Gradio server is deployed locally, the localhost_aliases variable includes "null" as a valid origin. This allows attackers to make unauthorized requests from sandboxed iframes or other sources with a null origin, potentially leading to data theft, such as user authentication tokens or uploaded files. This impacts users running Gradio locally, especially those using basic authentication.

Patches

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

Workarounds

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

As a workaround, users can manually modify the localhost_aliases list in their local Gradio deployment to exclude "null" as a valid origin. By removing this value, the Gradio server will no longer accept requests from sandboxed iframes or sources with a null origin, mitigating the potential for exploitation.

NVD (es)

Gradio es un paquete Python de código abierto diseñado para la creación rápida de prototipos. Esta vulnerabilidad se relaciona con la **validación de origen CORS que acepta un origen nulo**. Cuando se implementa un servidor Gradio localmente, la variable `localhost_aliases` incluye "null" como un origen válido. Esto permite a los atacantes realizar solicitudes no autorizadas desde iframes aislados u otras fuentes con un origen nulo, lo que puede provocar el robo de datos, como tokens de autenticación de usuario o archivos cargados. Esto afecta a los usuarios que ejecutan Gradio localmente, especialmente a los que usan autenticación básica. Se recomienda a los usuarios que actualicen a `gradio&gt;=5.0` para solucionar este problema. Como workaround, los usuarios pueden modificar manualmente la lista `localhost_aliases` en su implementación local de Gradio para excluir "null" como un origen válido. Al eliminar este valor, el servidor Gradio ya no aceptará solicitudes de iframes aislados o fuentes con un origen nulo, lo que mitiga el potencial de explotación.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-47165 changed 2024-10-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-89v2-pqfv-c5r9 changed 2025-01-21CC-BY-4.0
NVDCVE-2024-47165 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2024-214 changed 2025-01-19CC-BY-4.0