CVE-2024-47165 CORS origin validation accepts the null origin in Gradio
Attackers can bypass CORS restrictions using null origins to steal authentication tokens or files from locally deployed Gradio servers.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-47165?
CVE-2024-47165 is a medium-severity vulnerability in Gradio Project Gradio, published on 10 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-285
Which versions are affected by CVE-2024-47165?
3 open source packages ship an affected version, including gradio. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
gradio PyPI | All versions | 5.0.0 |
gradio PyPI | All versions | 5.0.0 |
gradio PyPI | All versions | 5.0.0 |
Products include Gradio Project Gradio.
How do I fix CVE-2024-47165?
Upgrade gradio to 5.0.0 or later.
Is CVE-2024-47165 being exploited?
There is no known exploitation of CVE-2024-47165 in the wild and no public exploit code.
Other vulnerabilities in Gradio Project Gradio
- CVE-2024-39236 Withdrawn Advisory: Gradio was discovered to contain a code injection vulnerability via the component /gradio/component_meta.py
- CVE-2023-6572 Command Injection in gradio-app/gradio
- CVE-2022-24770 Improper Neutralization of Formula Elements in a CSV File in Gradio Flagging
- CVE-2026-49119 Gradio < 6.16.0 Path Traversal via FileExplorer.preprocess()
- CVE-2025-23042 Gradio Blocked Path ACL Bypass Vulnerability
Sources
Also known as GHSA-89v2-pqfv-c5r9, PYSEC-2024-214.