NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Gradio

CVE-2024-47165: Gradio's CORS origin validation accepts the null origin

mediumCVSS 4.0 5.3 · 3.1 5.4GHSA-89v2-pqfv-c5r9

Gradio before 5.0 treats the 'null' origin as trusted on locally deployed servers, because localhost_aliases includes it. Pages in sandboxed iframes, which send a null origin, can then make requests to the server and steal authentication tokens or uploaded files. Upgrade to gradio 5.0.0.

Published Oct 10, 2024 · Updated Jan 21, 2025 · Analysis Nov 1, 2026

What an attacker can do

On a local deployment, Gradio's CORS check compares the request origin with a localhost_aliases list. That list contains the string "null". Browsers send a null origin from sandboxed iframes and some other contexts, so those requests pass the origin check as if they came from localhost.

An attacker can host a page that loads or embeds content in a sandboxed iframe and makes requests to the Gradio server on the victim's machine. The advisory says this can lead to theft of data such as user authentication tokens or uploaded files. The victim must open the attacker's page, so user interaction is needed. The CVSS vectors show low confidentiality and integrity impact.

The advisory says users running Gradio locally are affected, especially with basic authentication. A developer with a local Gradio tool open in the browser while browsing other sites is the typical case. This is a sibling of the cookie-based origin bug fixed in 4.44.0, but a different cause.

Who is affected

gradio on pip, all versions below 5.0.0, deployed locally. Check the version:

pip show gradio

Servers that use basic authentication and keep sessions open in a browser are the main concern.

gradio

Ecosystem
PyPI
Affected
< 5.0.0
Fixed in
5.0.0
Check
pip show gradio

How to fix it

Upgrade to gradio 5.0 or later:

pip install --upgrade "gradio>=5.0"

The patched version in the package data is 5.0.0. Without upgrading, the advisory says to edit the localhost_aliases list in your local Gradio deployment and remove "null". The server then stops accepting requests from null-origin sources.

How to tell if you were hit

Look in the Gradio server's access logs for requests with the header Origin: null, which normal use of the app does not produce. Check for uploaded files or sessions you do not recognise. Review which sites were open in the browser during the times those requests arrived.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to ahpaleus, Vasco-jofra.

Questions

What is a null origin and why does it matter here?

Browsers send Origin: null from sandboxed iframes and some other contexts. Gradio's localhost_aliases list included "null", so those requests were accepted as if they were local.

How is this different from CVE-2024-47084?

CVE-2024-47084 is a CORS check skipped when a cookie is present, fixed in 4.44.0. This one is a null origin accepted by localhost_aliases, fixed in 5.0.0.

Is there a workaround?

Yes. Remove "null" from the localhost_aliases list in your local Gradio deployment, or upgrade to 5.0.0.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Gradio vulnerabilities

All Gradio entries