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

CVE-2024-47870: Gradio has a race condition in update_root_in_config may redirect user traffic

highCVSS 4.0 8.8 · 3.1 7.0GHSA-xh2x-3mrm-fwqm

Gradio before 5.0 has a race condition in update_root_in_config that lets an attacker change the root URL the frontend uses to reach its backend. That can send users' traffic, including credentials and uploaded files, to a server the attacker controls. Upgrade to gradio 5.0.0.

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

What an attacker can do

The update_root_in_config function sets the root URL that the Gradio frontend uses when it talks to the backend. The advisory says a race condition in that function lets an attacker modify the value. The advisory does not describe the exact timing.

If the root points at an attacker's server, the browser sends later requests there. The advisory says that can expose authentication credentials and uploaded files to interception. The CVSS 3.1 vector shows network access, no privileges and no user interaction, with high attack complexity because the attacker must win the race. The 4.0 vector rates the same flaw at 8.8.

The advisory says all users who connect to a Gradio server are affected, particularly servers exposed to the internet, where malicious actors can try the race. For a team, this means a public demo or internal tool that accepts logins or file uploads can quietly send those to a third party.

Who is affected

gradio on pip, all versions below 5.0.0. Internet-facing servers are most exposed, because the attacker must send many requests to win the race. Versions 5.0.0 and later are not listed as affected. Check the installed version:

pip show gradio

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.0 or later:

pip install --upgrade "gradio>=5"

The advisory lists no workaround, so upgrading is the only remediation it gives. If you cannot upgrade at once, avoid exposing the server to the internet.

How to tell if you were hit

Check what root or base URL the Gradio frontend receives in the app's config, and compare it with your real host name. In browser developer tools, look for page requests that go to a host other than your Gradio server. Review proxy logs for bursts of concurrent requests to the same server from one client, which would match an attempt to win the race.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

What kind of vulnerability is it? Who is impacted?

This vulnerability involves a race condition in the update_root_in_config function, allowing an attacker to modify the root URL used by the Gradio frontend to communicate with the backend. By exploiting this flaw, an attacker can redirect user traffic to a malicious server. This could lead to the interception of sensitive data such as authentication credentials or uploaded files. This impacts all users who connect to a Gradio server, especially those exposed to the internet, where malicious actors could exploit this race condition.

Patches

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

Credited to ahpaleus, Vasco-jofra.

Questions

What does CVE-2024-47870 let an attacker do?

Change the root URL used by the Gradio frontend, so user traffic goes to a malicious server. Credentials and uploaded files may be intercepted.

Why is attack complexity high?

It is a race condition, so the attacker has to time requests against the server. The advisory does not describe the timing.

Is there a workaround?

None listed. Upgrade to gradio 5.0.0 or later.

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