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 package | Versions | Reported by |
|---|---|---|
| gradio-app gradio | < 5.0 | CVE List |
| gradio_project gradio | before 5.0, before 5.0.0 | CVE List, NVD |
| gradio (PyPI) | before 5.0.0 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N |
| GitHub | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N |
| NVD | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
| PyPA Advisory Database | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N |
Classification
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>=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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-47165 changed 2024-10-11 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-89v2-pqfv-c5r9 changed 2025-01-21 | CC-BY-4.0 |
| NVD | CVE-2024-47165 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2024-214 changed 2025-01-19 | CC-BY-4.0 |